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