@@ -640,11 +640,13 @@ describe("SlidingSyncSdk", () => {
640640 client ! . crypto ! . stop ( ) ;
641641 } ) ;
642642
643- it ( "gets enabled on the initial request only" , ( ) => {
644- expect ( ext . onRequest ( true ) ) . toEqual ( {
643+ it ( "gets enabled all the time" , async ( ) => {
644+ expect ( await ext . onRequest ( true ) ) . toEqual ( {
645+ enabled : true ,
646+ } ) ;
647+ expect ( await ext . onRequest ( false ) ) . toEqual ( {
645648 enabled : true ,
646649 } ) ;
647- expect ( ext . onRequest ( false ) ) . toEqual ( undefined ) ;
648650 } ) ;
649651
650652 it ( "can update device lists" , ( ) => {
@@ -686,11 +688,13 @@ describe("SlidingSyncSdk", () => {
686688 ext = findExtension ( "account_data" ) ;
687689 } ) ;
688690
689- it ( "gets enabled on the initial request only" , ( ) => {
690- expect ( ext . onRequest ( true ) ) . toEqual ( {
691+ it ( "gets enabled all the time" , async ( ) => {
692+ expect ( await ext . onRequest ( true ) ) . toEqual ( {
693+ enabled : true ,
694+ } ) ;
695+ expect ( await ext . onRequest ( false ) ) . toEqual ( {
691696 enabled : true ,
692697 } ) ;
693- expect ( ext . onRequest ( false ) ) . toEqual ( undefined ) ;
694698 } ) ;
695699
696700 it ( "processes global account data" , async ( ) => {
@@ -814,8 +818,12 @@ describe("SlidingSyncSdk", () => {
814818 ext = findExtension ( "to_device" ) ;
815819 } ) ;
816820
817- it ( "gets enabled with a limit on the initial request only" , ( ) => {
818- const reqJson : any = ext . onRequest ( true ) ;
821+ it ( "gets enabled all the time" , async ( ) => {
822+ let reqJson : any = await ext . onRequest ( true ) ;
823+ expect ( reqJson . enabled ) . toEqual ( true ) ;
824+ expect ( reqJson . limit ) . toBeGreaterThan ( 0 ) ;
825+ expect ( reqJson . since ) . toBeUndefined ( ) ;
826+ reqJson = await ext . onRequest ( false ) ;
819827 expect ( reqJson . enabled ) . toEqual ( true ) ;
820828 expect ( reqJson . limit ) . toBeGreaterThan ( 0 ) ;
821829 expect ( reqJson . since ) . toBeUndefined ( ) ;
@@ -826,7 +834,7 @@ describe("SlidingSyncSdk", () => {
826834 next_batch : "12345" ,
827835 events : [ ] ,
828836 } ) ;
829- expect ( ext . onRequest ( false ) ) . toEqual ( {
837+ expect ( await ext . onRequest ( false ) ) . toMatchObject ( {
830838 since : "12345" ,
831839 } ) ;
832840 } ) ;
@@ -910,11 +918,13 @@ describe("SlidingSyncSdk", () => {
910918 ext = findExtension ( "typing" ) ;
911919 } ) ;
912920
913- it ( "gets enabled on the initial request only" , ( ) => {
914- expect ( ext . onRequest ( true ) ) . toEqual ( {
921+ it ( "gets enabled all the time" , async ( ) => {
922+ expect ( await ext . onRequest ( true ) ) . toEqual ( {
923+ enabled : true ,
924+ } ) ;
925+ expect ( await ext . onRequest ( false ) ) . toEqual ( {
915926 enabled : true ,
916927 } ) ;
917- expect ( ext . onRequest ( false ) ) . toEqual ( undefined ) ;
918928 } ) ;
919929
920930 it ( "processes typing notifications" , async ( ) => {
@@ -1035,11 +1045,13 @@ describe("SlidingSyncSdk", () => {
10351045 ext = findExtension ( "receipts" ) ;
10361046 } ) ;
10371047
1038- it ( "gets enabled on the initial request only" , ( ) => {
1039- expect ( ext . onRequest ( true ) ) . toEqual ( {
1048+ it ( "gets enabled all the time" , async ( ) => {
1049+ expect ( await ext . onRequest ( true ) ) . toEqual ( {
1050+ enabled : true ,
1051+ } ) ;
1052+ expect ( await ext . onRequest ( false ) ) . toEqual ( {
10401053 enabled : true ,
10411054 } ) ;
1042- expect ( ext . onRequest ( false ) ) . toEqual ( undefined ) ;
10431055 } ) ;
10441056
10451057 it ( "processes receipts" , async ( ) => {
0 commit comments