Skip to content

Commit effc3b2

Browse files
committed
update tests
1 parent 6d4ef00 commit effc3b2

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/anonymousUserTracking/tests/userMergeScenarios.test.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ describe('UserMergeScenariosTests', () => {
135135
const removeItemCalls = localStorageMock.removeItem.mock.calls.filter(
136136
(call) => call[0] === SHARED_PREFS_EVENT_LIST_KEY
137137
);
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
138+
// count 2 is because we want to remove the anon user and remove anon details
140139
expect(removeItemCalls.length).toBe(1);
141140
const mergePostRequestData = mockRequest.history.post.find(
142141
(req) => req.url === ENDPOINT_MERGE_USER
@@ -175,7 +174,6 @@ describe('UserMergeScenariosTests', () => {
175174
(call) => call[0] === SHARED_PREFS_EVENT_LIST_KEY
176175
);
177176
// count 2 means it removed items and so syncEvents was called
178-
179177
// because removeItem gets called one time for
180178
// the key in case of logout and 2nd time on syncevents
181179
expect(removeItemCalls.length).toBe(2);
@@ -574,9 +572,8 @@ describe('UserMergeScenariosTests', () => {
574572
const removeItemCalls = localStorageMock.removeItem.mock.calls.filter(
575573
(call) => call[0] === SHARED_PREFS_EVENT_LIST_KEY
576574
);
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);
580577
const mergePostRequestData = mockRequest.history.post.find(
581578
(req) => req.url === ENDPOINT_MERGE_USER
582579
);

0 commit comments

Comments
 (0)