Fix test
This commit is contained in:
parent
d14309f99b
commit
905023d0e8
1 changed files with 9 additions and 1 deletions
|
@ -42,12 +42,20 @@ describe("LogoutDialog", () => {
|
||||||
expect(rendered.container).toMatchSnapshot();
|
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.getActiveSessionBackupVersion.mockResolvedValue("1");
|
||||||
|
mockCrypto.isSecretStorageReady.mockResolvedValue(true);
|
||||||
const rendered = renderComponent();
|
const rendered = renderComponent();
|
||||||
await rendered.findByText("Are you sure you want to sign out?");
|
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 () => {
|
it("Prompts user to connect backup if there is a backup on the server", async () => {
|
||||||
mockCrypto.getKeyBackupInfo.mockResolvedValue({} as KeyBackupInfo);
|
mockCrypto.getKeyBackupInfo.mockResolvedValue({} as KeyBackupInfo);
|
||||||
const rendered = renderComponent();
|
const rendered = renderComponent();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue