Add playwright test & clarify slightly confusing comment

This commit is contained in:
David Baker 2025-02-06 15:37:18 +01:00
parent e70afdb04f
commit 40f9bd9480
2 changed files with 16 additions and 1 deletions

View File

@ -111,4 +111,19 @@ test.describe("Encryption tab", () => {
// The user is prompted to reset their identity
await expect(dialog.getByText("Forgot your recovery key? Youll need to reset your identity.")).toBeVisible();
});
test("should warn before turning off key storage", async ({ page, app, util }) => {
await verifySession(app, "new passphrase");
await util.openEncryptionTab();
await page.getByRole("checkbox", { name: "Allow key storage" }).click();
await expect(
page.getByRole("heading", { name: "Are you sure you want to turn off key storage and delete it?" }),
).toBeVisible();
await page.getByRole("button", { name: "Delete key storage" }).click();
await expect(page.getByRole("checkbox", { name: "Allow key storage" })).not.toBeChecked();
});
});

View File

@ -97,7 +97,7 @@ export function useKeyStoragePanelViewModel(): KeyStoragePanelState {
// finally, set a flag to say that the user doesn't want key backup.
// Element X uses this to determine whether to set up automatically,
// so this will prevent EX from turning it back on.
// so this will stop EX turning it back on spontaneously.
await matrixClient.setAccountData("m.org.matrix.custom.backup_disabled", { disabled: true });
}