@@ -135,9 +135,8 @@ describe('UserMergeScenariosTests', () => {
135
135
const removeItemCalls = localStorageMock . removeItem . mock . calls . filter (
136
136
( call ) => call [ 0 ] === SHARED_PREFS_EVENT_LIST_KEY
137
137
) ;
138
- // count 1 means it did not remove item and so syncEvents was NOT called
139
- // because removeItem gets called one time for the key in case of logout
140
- expect ( removeItemCalls . length ) . toBe ( 1 ) ;
138
+ // count 2 is because we want to remove the anon user and remove anon details
139
+ expect ( removeItemCalls . length ) . toBe ( 2 ) ;
141
140
const mergePostRequestData = mockRequest . history . post . find (
142
141
( req ) => req . url === ENDPOINT_MERGE_USER
143
142
) ;
@@ -175,7 +174,6 @@ describe('UserMergeScenariosTests', () => {
175
174
( call ) => call [ 0 ] === SHARED_PREFS_EVENT_LIST_KEY
176
175
) ;
177
176
// count 2 means it removed items and so syncEvents was called
178
-
179
177
// because removeItem gets called one time for
180
178
// the key in case of logout and 2nd time on syncevents
181
179
expect ( removeItemCalls . length ) . toBe ( 2 ) ;
@@ -574,9 +572,8 @@ describe('UserMergeScenariosTests', () => {
574
572
const removeItemCalls = localStorageMock . removeItem . mock . calls . filter (
575
573
( call ) => call [ 0 ] === SHARED_PREFS_EVENT_LIST_KEY
576
574
) ;
577
- // count 1 means it did not remove item and so syncEvents was NOT called
578
- // because removeItem gets called one time for the key in case of logout
579
- expect ( removeItemCalls . length ) . toBe ( 1 ) ;
575
+ // count 2 is because we want to remove the anon user and remove anon details
576
+ expect ( removeItemCalls . length ) . toBe ( 2 ) ;
580
577
const mergePostRequestData = mockRequest . history . post . find (
581
578
( req ) => req . url === ENDPOINT_MERGE_USER
582
579
) ;
0 commit comments