@@ -241,7 +241,7 @@ describe('action creators', () => {
241241 } )
242242 } )
243243
244- it . only ( 'uses existing fragment nodes as placeholders for deferred fragments' , ( ) => {
244+ it ( 'uses existing fragment nodes as placeholders for deferred fragments' , ( ) => {
245245 const initialState = ( ) => {
246246 return {
247247 pages : {
@@ -357,6 +357,10 @@ describe('action creators', () => {
357357 type : '@@superglue/BEFORE_FETCH' ,
358358 payload : expect . any ( Object ) ,
359359 } ,
360+ {
361+ type : '@@superglue/RECEIVE_RESPONSE' ,
362+ payload : expect . any ( Object ) ,
363+ } ,
360364 {
361365 type : '@@superglue/HANDLE_GRAFT' ,
362366 payload : {
@@ -475,6 +479,10 @@ describe('action creators', () => {
475479 type : '@@superglue/BEFORE_FETCH' ,
476480 payload : expect . any ( Object ) ,
477481 } ,
482+ {
483+ type : '@@superglue/RECEIVE_RESPONSE' ,
484+ payload : expect . any ( Object ) ,
485+ } ,
478486 {
479487 type : '@@superglue/HANDLE_GRAFT' ,
480488 payload : {
@@ -788,6 +796,10 @@ describe('action creators', () => {
788796 ] ,
789797 } ,
790798 } ,
799+ {
800+ type : '@@superglue/RECEIVE_RESPONSE' ,
801+ payload : expect . any ( Object ) ,
802+ } ,
791803 {
792804 type : '@@superglue/SAVE_RESPONSE' ,
793805 payload : {
@@ -841,6 +853,7 @@ describe('action creators', () => {
841853 data : {
842854 posts : [ 'post 2' ] ,
843855 } ,
856+ action : 'savePage' ,
844857 fragments : [ ] ,
845858 csrfToken : 'token' ,
846859 assets : [ ] ,
@@ -875,11 +888,16 @@ describe('action creators', () => {
875888 ] ,
876889 } ,
877890 } ,
891+ {
892+ type : '@@superglue/RECEIVE_RESPONSE' ,
893+ payload : expect . any ( Object ) ,
894+ } ,
878895 {
879896 type : '@@superglue/SAVE_RESPONSE' ,
880897 payload : {
881898 pageKey : '/foo' ,
882899 page : {
900+ action : 'savePage' ,
883901 data : { posts : [ 'post 1' , 'post 2' ] } ,
884902 csrfToken : 'token' ,
885903 assets : [ ] ,
@@ -1550,16 +1568,24 @@ describe('action creators', () => {
15501568 type : '@@superglue/COPY_PAGE' ,
15511569 payload : { from : '/current' , to : '/details' } ,
15521570 } ,
1571+ {
1572+ type : '@@superglue/RECEIVE_RESPONSE' ,
1573+ payload : expect . any ( Object ) ,
1574+ } ,
15531575 {
15541576 type : '@@superglue/HANDLE_GRAFT' ,
15551577 payload : expect . any ( Object ) ,
15561578 } ,
15571579 ]
15581580
1559- store . dispatch ( visit ( '/details?props_at=data.address' ) ) . then ( ( meta ) => {
1560- expect ( allSuperglueActions ( store ) ) . toEqual ( expectedActions )
1561- done ( )
1562- } )
1581+ store
1582+ . dispatch ( visit ( '/details?props_at=data.address' ) )
1583+ . then ( ( meta ) => {
1584+ expect ( allSuperglueActions ( store ) ) . toEqual ( expectedActions )
1585+ } )
1586+ . finally ( ( ) => {
1587+ done ( )
1588+ } )
15631589 } ) )
15641590
15651591 it ( 'uses an explicit placeholder when attempting to graft' , ( ) =>
@@ -1602,6 +1628,10 @@ describe('action creators', () => {
16021628 type : '@@superglue/COPY_PAGE' ,
16031629 payload : { from : '/current' , to : '/details' } ,
16041630 } ,
1631+ {
1632+ type : '@@superglue/RECEIVE_RESPONSE' ,
1633+ payload : expect . any ( Object ) ,
1634+ } ,
16051635 {
16061636 type : '@@superglue/HANDLE_GRAFT' ,
16071637 payload : expect . any ( Object ) ,
@@ -1616,6 +1646,8 @@ describe('action creators', () => {
16161646 )
16171647 . then ( ( meta ) => {
16181648 expect ( allSuperglueActions ( store ) ) . toEqual ( expectedActions )
1649+ } )
1650+ . finally ( ( ) => {
16191651 done ( )
16201652 } )
16211653 } ) )
0 commit comments