Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
  • Loading branch information
t3chguy committed Jan 14, 2025
1 parent 97fca2d commit 99da560
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/unit-tests/Lifecycle-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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();
});
Expand Down

0 comments on commit 99da560

Please sign in to comment.