Update key storage toggle when key storage status changes (#30934)
* update key storage toggle when key storage status changes Listen for the CryptoEvent.KeyBackupStatus event and update the state when it changes. * fixup! update key storage toggle when key storage status changes * add comment about handling event
This commit is contained in:
@@ -146,6 +146,29 @@ test.describe("Cryptography", function () {
|
||||
}).toPass();
|
||||
});
|
||||
|
||||
// When the user resets their identity, key storage also gets enabled.
|
||||
// Check that the toggle updates to show the correct state.
|
||||
test("Key backup status updates after resetting identity", async ({ page, app, user: aliceCredentials }) => {
|
||||
await app.client.bootstrapCrossSigning(aliceCredentials);
|
||||
|
||||
const encryptionTab = await app.settings.openUserSettings("Encryption");
|
||||
const keyStorageToggle = encryptionTab.getByRole("switch", { name: "Allow key storage" });
|
||||
// Check that key storage starts off as disabled
|
||||
expect(await keyStorageToggle.isChecked()).toBe(false);
|
||||
// Find "the Reset cryptographic identity" button
|
||||
await encryptionTab.getByRole("button", { name: "Reset cryptographic identity" }).click();
|
||||
|
||||
// Confirm
|
||||
await encryptionTab.getByRole("button", { name: "Continue" }).click();
|
||||
|
||||
// Enter the password
|
||||
await page.getByPlaceholder("Password").fill(aliceCredentials.password);
|
||||
await page.getByRole("button", { name: "Continue" }).click();
|
||||
|
||||
// Key storage should now be enabled
|
||||
expect(await keyStorageToggle.isChecked()).toBe(true);
|
||||
});
|
||||
|
||||
test(
|
||||
"creating a DM should work, being e2e-encrypted / user verification",
|
||||
{ tag: "@screenshot" },
|
||||
|
||||
Reference in New Issue
Block a user