Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
dbkr committed Dec 9, 2024
1 parent d14309f commit 905023d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/unit-tests/components/views/dialogs/LogoutDialog-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,20 @@ describe("LogoutDialog", () => {
expect(rendered.container).toMatchSnapshot();
});

it("shows a regular dialog if backups are working", async () => {
it("shows a regular dialog if backups and recovery are working", async () => {
mockCrypto.getActiveSessionBackupVersion.mockResolvedValue("1");
mockCrypto.isSecretStorageReady.mockResolvedValue(true);
const rendered = renderComponent();
await rendered.findByText("Are you sure you want to sign out?");
});

it("prompts user to set up recovery if backups are enabled but recovery isn't", async () => {
mockCrypto.getActiveSessionBackupVersion.mockResolvedValue("1");
mockCrypto.isSecretStorageReady.mockResolvedValue(false);
const rendered = renderComponent();
await rendered.findByText("You'll lose access to your encrypted messages");
});

it("Prompts user to connect backup if there is a backup on the server", async () => {
mockCrypto.getKeyBackupInfo.mockResolvedValue({} as KeyBackupInfo);
const rendered = renderComponent();
Expand Down

0 comments on commit 905023d

Please sign in to comment.