@@ -3,85 +3,85 @@ import { fromJS, List, Map, Set } from 'immutable';
33import { composeReducers } from './compose-reducers' ;
44
55xdescribe ( 'composeReducers' , ( ) => {
6- const compose = ( s1 : any , s2 : any , s3 : any ) => {
7- const r1 = ( state = s1 ) => state ;
8- const r2 = ( state = s2 ) => state ;
9- const r3 = ( state = s3 ) => state ;
6+ const compose = ( s1 : any , s2 : any , s3 : any ) => {
7+ const r1 = ( state = s1 ) => state ;
8+ const r2 = ( state = s2 ) => state ;
9+ const r3 = ( state = s3 ) => state ;
1010
11- const reducer = composeReducers ( r1 , r2 , r3 ) ;
11+ const reducer = composeReducers ( r1 , r2 , r3 ) ;
1212
13- return reducer ( undefined , { type : '' } ) ;
14- } ;
13+ return reducer ( undefined , { type : '' } ) ;
14+ } ;
1515
16- it ( 'can compose plain-object initial states' , ( ) => {
17- const state = compose (
18- { a : 1 } ,
19- { b : 1 } ,
20- { c : 1 } ,
21- ) ;
22- expect ( state ) . toBeDefined ( ) ;
23- expect ( state ) . toEqual ( { a : 1 , b : 1 , c : 1 } ) ;
24- } ) ;
16+ it ( 'can compose plain-object initial states' , ( ) => {
17+ const state = compose (
18+ { a : 1 } ,
19+ { b : 1 } ,
20+ { c : 1 } ,
21+ ) ;
22+ expect ( state ) . toBeDefined ( ) ;
23+ expect ( state ) . toEqual ( { a : 1 , b : 1 , c : 1 } ) ;
24+ } ) ;
2525
26- it ( 'can compose array states' , ( ) => {
27- const state = compose (
28- [ 1 ] ,
29- [ 2 ] ,
30- [ 3 ] ,
31- ) ;
32- expect ( state ) . toBeDefined ( ) ;
33- expect ( state ) . toEqual ( [ 1 , 2 , 3 ] ) ;
34- } ) ;
26+ it ( 'can compose array states' , ( ) => {
27+ const state = compose (
28+ [ 1 ] ,
29+ [ 2 ] ,
30+ [ 3 ] ,
31+ ) ;
32+ expect ( state ) . toBeDefined ( ) ;
33+ expect ( state ) . toEqual ( [ 1 , 2 , 3 ] ) ;
34+ } ) ;
3535
36- it ( 'can compose Immutable::Map initial states' , ( ) => {
37- const state = compose (
38- fromJS ( { a : 1 } ) ,
39- fromJS ( { b : 1 } ) ,
40- fromJS ( { c : 1 } ) ,
41- ) ;
42- expect ( Map . isMap ( state ) ) . toEqual ( true ) ;
36+ it ( 'can compose Immutable::Map initial states' , ( ) => {
37+ const state = compose (
38+ fromJS ( { a : 1 } ) ,
39+ fromJS ( { b : 1 } ) ,
40+ fromJS ( { c : 1 } ) ,
41+ ) ;
42+ expect ( Map . isMap ( state ) ) . toEqual ( true ) ;
4343
44- const plain = state . toJS ( ) ;
45- expect ( plain ) . not . toBeNull ( ) ;
46- expect ( plain ) . toEqual ( { a : 1 , b : 1 , c : 1 } ) ;
47- } ) ;
44+ const plain = state . toJS ( ) ;
45+ expect ( plain ) . not . toBeNull ( ) ;
46+ expect ( plain ) . toEqual ( { a : 1 , b : 1 , c : 1 } ) ;
47+ } ) ;
4848
49- it ( 'can compose Immutable::Set initial states' , ( ) => {
50- const state = compose (
51- Set . of ( 1 , 2 , 3 ) ,
52- Set . of ( 4 , 5 , 6 ) ,
53- Set . of ( ) ,
54- ) ;
55- expect ( Set . isSet ( state ) ) . toEqual ( true ) ;
49+ it ( 'can compose Immutable::Set initial states' , ( ) => {
50+ const state = compose (
51+ Set . of ( 1 , 2 , 3 ) ,
52+ Set . of ( 4 , 5 , 6 ) ,
53+ Set . of ( ) ,
54+ ) ;
55+ expect ( Set . isSet ( state ) ) . toEqual ( true ) ;
5656
57- const plain = state . toJS ( ) ;
58- expect ( plain ) . not . toBeNull ( ) ;
59- expect ( plain ) . toEqual ( [ 1 , 2 , 3 , 4 , 5 , 6 ] ) ;
60- } ) ;
57+ const plain = state . toJS ( ) ;
58+ expect ( plain ) . not . toBeNull ( ) ;
59+ expect ( plain ) . toEqual ( [ 1 , 2 , 3 , 4 , 5 , 6 ] ) ;
60+ } ) ;
6161
62- it ( 'can compose Immutable::OrderedSet initial states' , ( ) => {
63- const state = compose (
64- Set . of ( 3 , 2 , 1 ) ,
65- Set . of ( 4 , 6 , 5 ) ,
66- Set . of ( ) ,
67- ) ;
68- expect ( Set . isSet ( state ) ) . toEqual ( true ) ;
62+ it ( 'can compose Immutable::OrderedSet initial states' , ( ) => {
63+ const state = compose (
64+ Set . of ( 3 , 2 , 1 ) ,
65+ Set . of ( 4 , 6 , 5 ) ,
66+ Set . of ( ) ,
67+ ) ;
68+ expect ( Set . isSet ( state ) ) . toEqual ( true ) ;
6969
70- const plain = state . toJS ( ) ;
71- expect ( plain ) . not . toBeNull ( ) ;
72- expect ( plain ) . toEqual ( [ 3 , 2 , 1 , 4 , 6 , 5 ] ) ;
73- } ) ;
70+ const plain = state . toJS ( ) ;
71+ expect ( plain ) . not . toBeNull ( ) ;
72+ expect ( plain ) . toEqual ( [ 3 , 2 , 1 , 4 , 6 , 5 ] ) ;
73+ } ) ;
7474
75- it ( 'can compose Immutable::List initial states' , ( ) => {
76- const state = compose (
77- List . of ( 'a' , 'b' ) ,
78- List . of ( 'c' , 'd' ) ,
79- List . of ( ) ,
80- ) ;
81- expect ( List . isList ( state ) ) . toEqual ( true ) ;
75+ it ( 'can compose Immutable::List initial states' , ( ) => {
76+ const state = compose (
77+ List . of ( 'a' , 'b' ) ,
78+ List . of ( 'c' , 'd' ) ,
79+ List . of ( ) ,
80+ ) ;
81+ expect ( List . isList ( state ) ) . toEqual ( true ) ;
8282
83- const plain = state . toJS ( ) ;
84- expect ( plain ) . not . toBeNull ( ) ;
85- expect ( plain ) . toEqual ( [ 'a' , 'b' , 'c' , 'd' ] ) ;
86- } ) ;
83+ const plain = state . toJS ( ) ;
84+ expect ( plain ) . not . toBeNull ( ) ;
85+ expect ( plain ) . toEqual ( [ 'a' , 'b' , 'c' , 'd' ] ) ;
86+ } ) ;
8787} ) ;
0 commit comments