From 99da560c4304db481fc979e26c4865c85b606070 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 14 Jan 2025 10:16:48 +0000 Subject: [PATCH] Fix test Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/unit-tests/Lifecycle-test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/unit-tests/Lifecycle-test.ts b/test/unit-tests/Lifecycle-test.ts index 65dda6fec10..ba5885c414c 100644 --- a/test/unit-tests/Lifecycle-test.ts +++ b/test/unit-tests/Lifecycle-test.ts @@ -143,6 +143,11 @@ describe("Lifecycle", () => { const table = mockStore[tableKey]; delete table?.[key as string]; }); + jest.spyOn(StorageAccess, "idbClear") + .mockClear() + .mockImplementation(async (tableKey: string) => { + mockStore[tableKey] = {}; + }); }; const homeserverUrl = "https://server.org"; @@ -613,7 +618,7 @@ describe("Lifecycle", () => { it("should clear stores", async () => { await setLoggedIn(credentials); - expect(StorageAccess.idbDelete).toHaveBeenCalledWith("account", "mx_access_token"); + expect(StorageAccess.idbClear).toHaveBeenCalledWith("account"); expect(sessionStorage.clear).toHaveBeenCalled(); expect(mockClient.clearStores).toHaveBeenCalled(); });