@@ -61,16 +61,25 @@ test('simple actions returns type and payload', (t) => {
6161 foo : ( arg ) => ( { arg } ) ,
6262 } )
6363
64- t . deepEqual ( actions . foo ( 1 ) , { type : 'foo' , payload : 1 , 'symbiote-payload' : [ 1 ] } )
64+ const action = actions . foo ( 1 )
65+
66+ t . is ( action . payload , 1 )
67+ t . deepEqual ( action [ 'symbiote-payload' ] , [ 1 ] )
68+ t . true ( action . type . endsWith ( 'foo' ) )
6569} )
6670
6771test ( 'actions with state returns type and payload' , ( t ) => {
6872 const { actions } = createSymbiote ( { } , {
6973 bar : ( arg ) => ( state ) => ( { arg, state } ) ,
7074 } )
7175
72- t . deepEqual ( actions . bar ( 1 ) , { type : 'bar' , payload : 1 , 'symbiote-payload' : [ 1 ] } )
73- t . is ( actions . bar . toString ( ) , 'bar' , '.toString() return correct type' )
76+ const action = actions . bar ( 1 )
77+
78+ t . is ( action . payload , 1 )
79+ t . deepEqual ( action [ 'symbiote-payload' ] , [ 1 ] )
80+ t . true ( action . type . endsWith ( 'bar' ) )
81+
82+ t . true ( actions . bar . toString ( ) . endsWith ( 'bar' ) , '.toString() return correct type' )
7483} )
7584
7685test ( 'nested actions returns type and payload' , ( t ) => {
@@ -80,8 +89,13 @@ test('nested actions returns type and payload', (t) => {
8089 } ,
8190 } )
8291
83- t . deepEqual ( actions . bar . foo ( 1 ) , { type : 'bar/foo' , payload : 1 , 'symbiote-payload' : [ 1 ] } )
84- t . is ( actions . bar . foo . toString ( ) , 'bar/foo' , '.toString() return correct type' )
92+ const action = actions . bar . foo ( 1 )
93+
94+ t . true ( action . type . endsWith ( 'bar/foo' ) )
95+ t . is ( action . payload , 1 )
96+ t . deepEqual ( action [ 'symbiote-payload' ] , [ 1 ] )
97+
98+ t . true ( actions . bar . foo . toString ( ) . endsWith ( 'bar/foo' ) , '.toString() return correct type' )
8599} )
86100
87101test ( 'nested actions with state returns type and payload' , ( t ) => {
@@ -91,8 +105,13 @@ test('nested actions with state returns type and payload', (t) => {
91105 } ,
92106 } )
93107
94- t . deepEqual ( actions . foo . bar ( 1 ) , { type : 'foo/bar' , payload : 1 , 'symbiote-payload' : [ 1 ] } )
95- t . is ( actions . foo . bar . toString ( ) , 'foo/bar' , '.toString() return correct type' )
108+ const action = actions . foo . bar ( 1 )
109+
110+ t . true ( action . type . endsWith ( 'foo/bar' ) )
111+ t . is ( action . payload , 1 )
112+ t . deepEqual ( action [ 'symbiote-payload' ] , [ 1 ] )
113+
114+ t . true ( actions . foo . bar . toString ( ) . endsWith ( 'foo/bar' ) , '.toString() return correct type' )
96115} )
97116
98117test ( 'reducer return action resul' , ( t ) => {
0 commit comments