1 | "use strict";
|
2 |
|
3 | var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
4 |
|
5 | var _compose = _interopRequireDefault(require("recompose/compose"));
|
6 |
|
7 | var _pageDataReductions = require("./page-data-reductions");
|
8 |
|
9 | test('pageDataAddReductionFromDataProp', function () {
|
10 | expect((0, _pageDataReductions.pageDataAddReductionFromDataProp)({
|
11 | data: {
|
12 | a: 'a'
|
13 | }
|
14 | })({})).toEqual({
|
15 | a: 'a'
|
16 | });
|
17 | });
|
18 | test('pageDataAddInvalidFieldsReduction', function () {
|
19 | expect((0, _pageDataReductions.pageDataAddInvalidFieldsReduction)({
|
20 | a: 'a'
|
21 | })({})).toEqual({
|
22 | invalidFields: {
|
23 | a: 'a'
|
24 | }
|
25 | });
|
26 | });
|
27 | test('pageDataDeleteReduction', function () {
|
28 | var s = {
|
29 | foo: 'foo',
|
30 | bar: 'bar'
|
31 | };
|
32 | expect((0, _pageDataReductions.pageDataDeleteReduction)('foo')(s)).toEqual({
|
33 | bar: 'bar'
|
34 | });
|
35 | expect((0, _compose.default)((0, _pageDataReductions.pageDataDeleteReduction)('foo'))(s)).toEqual({
|
36 | bar: 'bar'
|
37 | });
|
38 | });
|
39 | test('pageDataClearReduction', function () {
|
40 | var s = {
|
41 | foo: 'foo'
|
42 | };
|
43 | expect((0, _pageDataReductions.pageDataClearReduction)()(s)).toEqual({});
|
44 | expect((0, _compose.default)((0, _pageDataReductions.pageDataClearReduction)())(s)).toEqual({});
|
45 | }); |
\ | No newline at end of file |