diff --git a/docs/config.md b/docs/config.md index 6376b55f82..47d148247f 100644 --- a/docs/config.md +++ b/docs/config.md @@ -155,7 +155,7 @@ complete re-branding/private labeling, a more personalised experience can be ach 3. `show_once`: Optional. If true then the notice will only be shown once per device. 18. `help_url`: The URL to point users to for help with the app, defaults to `https://element.io/help`. 19. `help_encryption_url`: The URL to point users to for help with encryption, defaults to `https://element.io/help#encryption`. -20. `force_verification`: If true, users must verify new logins (eg. with another device / their security key) +20. `force_verification`: If true, users must verify new logins (eg. with another device / their recovery key) ### `desktop_builds` and `mobile_builds` diff --git a/playwright/e2e/crypto/backups.spec.ts b/playwright/e2e/crypto/backups.spec.ts index 8209dedcee..e0cf1cc60b 100644 --- a/playwright/e2e/crypto/backups.spec.ts +++ b/playwright/e2e/crypto/backups.spec.ts @@ -58,8 +58,8 @@ test.describe("Backups", () => { // Create another await securityTab.getByRole("button", { name: "Set up", exact: true }).click(); - await expect(currentDialogLocator.getByRole("heading", { name: "Security Key" })).toBeVisible(); - await currentDialogLocator.getByLabel("Security Key").fill(securityKey); + await expect(currentDialogLocator.getByRole("heading", { name: "Recovery Key" })).toBeVisible(); + await currentDialogLocator.getByLabel("Recovery Key").fill(securityKey); await currentDialogLocator.getByRole("button", { name: "Continue", exact: true }).click(); // Should be successful @@ -90,8 +90,8 @@ test.describe("Backups", () => { // Try to create another await securityTab.getByRole("button", { name: "Set up", exact: true }).click(); - await expect(currentDialogLocator.getByRole("heading", { name: "Security Key" })).toBeVisible(); - // But cancel the security key dialog, to simulate not having the secret storage passphrase + await expect(currentDialogLocator.getByRole("heading", { name: "Recovery Key" })).toBeVisible(); + // But cancel the recovery key dialog, to simulate not having the secret storage passphrase await currentDialogLocator.getByTestId("dialog-cancel-button").click(); await expect(currentDialogLocator.getByRole("heading", { name: "Starting backup…" })).toBeVisible(); diff --git a/playwright/e2e/crypto/crypto.spec.ts b/playwright/e2e/crypto/crypto.spec.ts index 7cc61c927d..ace1b74c74 100644 --- a/playwright/e2e/crypto/crypto.spec.ts +++ b/playwright/e2e/crypto/crypto.spec.ts @@ -186,7 +186,7 @@ test.describe("Cryptography", function () { await page.getByRole("button", { name: "Clear cross-signing keys" }).click(); // Enter the 4S key - await page.getByPlaceholder("Security Key").fill(secretStorageKey); + await page.getByPlaceholder("Recovery Key").fill(secretStorageKey); await page.getByRole("button", { name: "Continue" }).click(); // Enter the password diff --git a/playwright/e2e/crypto/device-verification.spec.ts b/playwright/e2e/crypto/device-verification.spec.ts index 7757d813eb..ee710d1cfb 100644 --- a/playwright/e2e/crypto/device-verification.spec.ts +++ b/playwright/e2e/crypto/device-verification.spec.ts @@ -119,7 +119,7 @@ test.describe("Device verification", { tag: "@no-webkit" }, () => { await logIntoElement(page, credentials); // Select the security phrase - await page.locator(".mx_AuthPage").getByRole("button", { name: "Verify with Security Key or Phrase" }).click(); + await page.locator(".mx_AuthPage").getByRole("button", { name: "Verify with Recovery Key or Phrase" }).click(); // Fill the passphrase const dialog = page.locator(".mx_Dialog"); @@ -136,15 +136,15 @@ test.describe("Device verification", { tag: "@no-webkit" }, () => { await checkDeviceIsConnectedKeyBackup(app, expectedBackupVersion, true); }); - test("Verify device with Security Key during login", async ({ page, app, credentials, homeserver }) => { + test("Verify device with Recovery Key during login", async ({ page, app, credentials, homeserver }) => { await logIntoElement(page, credentials); // Select the security phrase - await page.locator(".mx_AuthPage").getByRole("button", { name: "Verify with Security Key or Phrase" }).click(); + await page.locator(".mx_AuthPage").getByRole("button", { name: "Verify with Recovery Key or Phrase" }).click(); - // Fill the security key + // Fill the recovery key const dialog = page.locator(".mx_Dialog"); - await dialog.getByRole("button", { name: "use your Security Key" }).click(); + await dialog.getByRole("button", { name: "use your Recovery Key" }).click(); const aliceRecoveryKey = await aliceBotClient.getRecoveryKey(); await dialog.locator("#mx_securityKey").fill(aliceRecoveryKey.encodedPrivateKey); await dialog.locator(".mx_Dialog_primary:not([disabled])", { hasText: "Continue" }).click(); diff --git a/playwright/e2e/crypto/toasts.spec.ts b/playwright/e2e/crypto/toasts.spec.ts index 8b19b6ea61..905a8fb1ed 100644 --- a/playwright/e2e/crypto/toasts.spec.ts +++ b/playwright/e2e/crypto/toasts.spec.ts @@ -35,7 +35,7 @@ test.describe("Key storage out of sync toast", () => { await page.getByRole("button", { name: "Enter recovery key" }).click(); - await page.getByRole("textbox", { name: "Security key" }).fill(recoveryKey.encodedPrivateKey); + await page.getByRole("textbox", { name: "Recovery Key" }).fill(recoveryKey.encodedPrivateKey); await page.getByRole("button", { name: "Continue" }).click(); await expect(page.getByRole("button", { name: "Enter recovery key" })).not.toBeVisible(); diff --git a/playwright/e2e/crypto/utils.ts b/playwright/e2e/crypto/utils.ts index a9fa14a277..a359880b6e 100644 --- a/playwright/e2e/crypto/utils.ts +++ b/playwright/e2e/crypto/utils.ts @@ -216,13 +216,13 @@ export async function logIntoElement(page: Page, credentials: Credentials, secur // if a securityKey was given, verify the new device if (securityKey !== undefined) { - await page.locator(".mx_AuthPage").getByRole("button", { name: "Verify with Security Key" }).click(); + await page.locator(".mx_AuthPage").getByRole("button", { name: "Verify with Recovery Key" }).click(); - const useSecurityKey = page.locator(".mx_Dialog").getByRole("button", { name: "use your Security Key" }); + const useSecurityKey = page.locator(".mx_Dialog").getByRole("button", { name: "use your Recovery Key" }); if (await useSecurityKey.isVisible()) { await useSecurityKey.click(); } - // Fill in the security key + // Fill in the recovery key await page.locator(".mx_Dialog").locator('input[type="password"]').fill(securityKey); await page.locator(".mx_Dialog_primary:not([disabled])", { hasText: "Continue" }).click(); await page.getByRole("button", { name: "Done" }).click(); @@ -249,15 +249,15 @@ export async function logOutOfElement(page: Page, discardKeys: boolean = false) } /** - * Open the encryption settings, and verify the current session using the security key. + * Open the encryption settings, and verify the current session using the recovery key. * * @param app - `ElementAppPage` wrapper for the playwright `Page`. - * @param securityKey - The security key (i.e., 4S key), set up during a previous session. + * @param securityKey - The recovery key (i.e., 4S key), set up during a previous session. */ export async function verifySession(app: ElementAppPage, securityKey: string) { const settings = await app.settings.openUserSettings("Encryption"); await settings.getByRole("button", { name: "Verify this device" }).click(); - await app.page.getByRole("button", { name: "Verify with Security Key" }).click(); + await app.page.getByRole("button", { name: "Verify with Recovery Key" }).click(); await app.page.locator(".mx_Dialog").locator('input[type="password"]').fill(securityKey); await app.page.getByRole("button", { name: "Continue", disabled: false }).click(); await app.page.getByRole("button", { name: "Done" }).click(); @@ -291,7 +291,7 @@ export async function doTwoWaySasVerification(page: Page, verifier: JSHandle { await app.settings.openUserSettings("Security & Privacy"); @@ -319,9 +319,9 @@ export async function completeCreateSecretStorageDialog( const currentDialogLocator = page.locator(".mx_Dialog"); await expect(currentDialogLocator.getByRole("heading", { name: "Set up Secure Backup" })).toBeVisible(); - // "Generate a Security Key" is selected by default + // "Generate a Recovery Key" is selected by default await currentDialogLocator.getByRole("button", { name: "Continue", exact: true }).click(); - await expect(currentDialogLocator.getByRole("heading", { name: "Save your Security Key" })).toBeVisible(); + await expect(currentDialogLocator.getByRole("heading", { name: "Save your Recovery Key" })).toBeVisible(); await currentDialogLocator.getByRole("button", { name: "Copy", exact: true }).click(); // copy the recovery key to use it later const recoveryKey = await page.evaluate(() => navigator.clipboard.readText()); @@ -345,7 +345,7 @@ export async function completeCreateSecretStorageDialog( } /** - * Click on copy and continue buttons to dismiss the security key dialog + * Click on copy and continue buttons to dismiss the recovery key dialog */ export async function copyAndContinue(page: Page) { await page.getByRole("button", { name: "Copy" }).click(); diff --git a/playwright/e2e/settings/encryption-user-tab/index.ts b/playwright/e2e/settings/encryption-user-tab/index.ts index 22dcd9041b..a7351fd2b4 100644 --- a/playwright/e2e/settings/encryption-user-tab/index.ts +++ b/playwright/e2e/settings/encryption-user-tab/index.ts @@ -43,7 +43,7 @@ class Helpers { */ async verifyDevice(recoveryKey: GeneratedSecretStorageKey) { // Select the security phrase - await this.page.getByRole("button", { name: "Verify with Security Key" }).click(); + await this.page.getByRole("button", { name: "Verify with Recovery Key" }).click(); await this.enterRecoveryKey(recoveryKey); await this.page.getByRole("button", { name: "Done" }).click(); } @@ -91,7 +91,7 @@ class Helpers { } /** - * Get the security key from the clipboard and fill in the input field + * Get the recovery key from the clipboard and fill in the input field * Then click on the finish button * @param title - The title of the dialog * @param confirmButtonLabel - The label of the confirm button diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 24160e7432..fff6e25642 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -877,22 +877,22 @@ "empty_room_was_name": "Empty room (was %(oldName)s)", "encryption": { "access_secret_storage_dialog": { - "enter_phrase_or_key_prompt": "Enter your Security Phrase or to continue.", + "enter_phrase_or_key_prompt": "Enter your Security Phrase or to continue.", "key_validation_text": { - "invalid_security_key": "Invalid Security Key", + "invalid_security_key": "Invalid Recovery Key", "recovery_key_is_correct": "Looks good!", "wrong_file_type": "Wrong file type", - "wrong_security_key": "Wrong Security Key" + "wrong_security_key": "Wrong Recovery Key" }, "reset_title": "Reset everything", "reset_warning_1": "Only do this if you have no other device to complete verification with.", "reset_warning_2": "If you reset everything, you will restart with no trusted sessions, no trusted users, and might not be able to see past messages.", "restoring": "Restoring keys from backup", - "security_key_title": "Security Key", + "security_key_title": "Recovery Key", "security_phrase_incorrect_error": "Unable to access secret storage. Please verify that you entered the correct Security Phrase.", "security_phrase_title": "Security Phrase", "separator": "%(securityKey)s or %(recoveryFile)s", - "use_security_key_prompt": "Use your Security Key to continue." + "use_security_key_prompt": "Use your Recovery Key to continue." }, "bootstrap_title": "Setting up keys", "cancel_entering_passphrase_description": "Are you sure you want to cancel entering passphrase?", @@ -995,7 +995,7 @@ "incoming_sas_dialog_waiting": "Waiting for partner to confirm…", "incoming_sas_user_dialog_text_1": "Verify this user to mark them as trusted. Trusting users gives you extra peace of mind when using end-to-end encrypted messages.", "incoming_sas_user_dialog_text_2": "Verifying this user will mark their session as trusted, and also mark your session as trusted to them.", - "no_key_or_device": "It looks like you don't have a Security Key or any other devices you can verify against. This device will not be able to access old encrypted messages. In order to verify your identity on this device, you'll need to reset your verification keys.", + "no_key_or_device": "It looks like you don't have a Recovery Key or any other devices you can verify against. This device will not be able to access old encrypted messages. In order to verify your identity on this device, you'll need to reset your verification keys.", "no_support_qr_emoji": "The device you are trying to verify doesn't support scanning a QR code or emoji verification, which is what %(brand)s supports. Try with a different client.", "other_party_cancelled": "The other party cancelled the verification.", "prompt_encrypted": "Verify all users in a room to ensure it's secure.", @@ -1045,10 +1045,10 @@ "verify_emoji_prompt_qr": "If you can't scan the code above, verify by comparing unique emoji.", "verify_later": "I'll verify later", "verify_reset_warning_1": "Resetting your verification keys cannot be undone. After resetting, you won't have access to old encrypted messages, and any friends who have previously verified you will see security warnings until you re-verify with them.", - "verify_reset_warning_2": "Please only proceed if you're sure you've lost all of your other devices and your Security Key.", + "verify_reset_warning_2": "Please only proceed if you're sure you've lost all of your other devices and your Recovery Key.", "verify_using_device": "Verify with another device", - "verify_using_key": "Verify with Security Key", - "verify_using_key_or_phrase": "Verify with Security Key or Phrase", + "verify_using_key": "Verify with Recovery Key", + "verify_using_key_or_phrase": "Verify with Recovery Key or Phrase", "waiting_for_user_accept": "Waiting for %(displayName)s to accept…", "waiting_other_device": "Waiting for you to verify on your other device…", "waiting_other_device_details": "Waiting for you to verify on your other device, %(deviceName)s (%(deviceId)s)…", @@ -1799,24 +1799,24 @@ "restore_key_backup_dialog": { "count_of_decryption_failures": "Failed to decrypt %(failedCount)s sessions!", "count_of_successfully_restored_keys": "Successfully restored %(sessionCount)s keys", - "enter_key_description": "Access your secure message history and set up secure messaging by entering your Security Key.", - "enter_key_title": "Enter Security Key", + "enter_key_description": "Access your secure message history and set up secure messaging by entering your Recovery Key.", + "enter_key_title": "Enter Recovery Key", "enter_phrase_description": "Access your secure message history and set up secure messaging by entering your Security Phrase.", "enter_phrase_title": "Enter Security Phrase", "incorrect_security_phrase_dialog": "Backup could not be decrypted with this Security Phrase: please verify that you entered the correct Security Phrase.", "incorrect_security_phrase_title": "Incorrect Security Phrase", "key_backup_warning": "Warning: you should only set up key backup from a trusted computer.", "key_fetch_in_progress": "Fetching keys from server…", - "key_forgotten_text": "If you've forgotten your Security Key you can ", - "key_is_invalid": "Not a valid Security Key", - "key_is_valid": "This looks like a valid Security Key!", + "key_forgotten_text": "If you've forgotten your Recovery Key you can ", + "key_is_invalid": "Not a valid Recovery Key", + "key_is_valid": "This looks like a valid Recovery Key!", "keys_restored_title": "Keys restored", "load_error_content": "Unable to load backup status", "load_keys_progress": "%(completed)s of %(total)s keys restored", "no_backup_error": "No backup found!", - "phrase_forgotten_text": "If you've forgotten your Security Phrase you can use your Security Key or set up new recovery options", - "recovery_key_mismatch_description": "Backup could not be decrypted with this Security Key: please verify that you entered the correct Security Key.", - "recovery_key_mismatch_title": "Security Key mismatch", + "phrase_forgotten_text": "If you've forgotten your Security Phrase you can use your Recovery Key or set up new recovery options", + "recovery_key_mismatch_description": "Backup could not be decrypted with this Recovery Key: please verify that you entered the correct Recovery Key.", + "recovery_key_mismatch_title": "Recovery Key mismatch", "restore_failed_error": "Unable to restore backup" }, "right_panel": { @@ -2616,21 +2616,21 @@ "enter_phrase_description": "Enter a Security Phrase only you know, as it's used to safeguard your data. To be secure, you shouldn't re-use your account password.", "enter_phrase_title": "Enter a Security Phrase", "enter_phrase_to_confirm": "Enter your Security Phrase a second time to confirm it.", - "generate_security_key_description": "We'll generate a Security Key for you to store somewhere safe, like a password manager or a safe.", - "generate_security_key_title": "Generate a Security Key", + "generate_security_key_description": "We'll generate a Recovery Key for you to store somewhere safe, like a password manager or a safe.", + "generate_security_key_title": "Generate a Recovery Key", "pass_phrase_match_failed": "That doesn't match.", "pass_phrase_match_success": "That matches!", "phrase_strong_enough": "Great! This Security Phrase looks strong enough.", "secret_storage_query_failure": "Unable to query secret storage status", - "security_key_safety_reminder": "Store your Security Key somewhere safe, like a password manager or a safe, as it's used to safeguard your encrypted data.", + "security_key_safety_reminder": "Store your Recovery Key somewhere safe, like a password manager or a safe, as it's used to safeguard your encrypted data.", "set_phrase_again": "Go back to set it again.", "settings_reminder": "You can also set up Secure Backup & manage your keys in Settings.", "title_confirm_phrase": "Confirm Security Phrase", - "title_save_key": "Save your Security Key", + "title_save_key": "Save your Recovery Key", "title_set_phrase": "Set a Security Phrase", "unable_to_setup": "Unable to set up secret storage", "use_different_passphrase": "Use a different passphrase?", - "use_phrase_only_you_know": "Use a secret phrase only you know, and optionally save a Security Key to use for backup." + "use_phrase_only_you_know": "Use a secret phrase only you know, and optionally save a Recovery Key to use for backup." } }, "key_export_import": { @@ -2749,7 +2749,7 @@ "backup_key_stored_status": "Backup key stored:", "backup_key_unexpected_type": "unexpected type", "backup_key_well_formed": "well formed", - "backup_keys_description": "Back up your encryption keys with your account data in case you lose access to your sessions. Your keys will be secured with a unique Security Key.", + "backup_keys_description": "Back up your encryption keys with your account data in case you lose access to your sessions. Your keys will be secured with a unique Recovery Key.", "bulk_options_accept_all_invites": "Accept all %(invitedRooms)s invites", "bulk_options_reject_all_invites": "Reject all %(invitedRooms)s invites", "bulk_options_section": "Bulk options", diff --git a/test/unit-tests/components/views/dialogs/AccessSecretStorageDialog-test.tsx b/test/unit-tests/components/views/dialogs/AccessSecretStorageDialog-test.tsx index 03f6520dbd..e0320b2908 100644 --- a/test/unit-tests/components/views/dialogs/AccessSecretStorageDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/AccessSecretStorageDialog-test.tsx @@ -14,7 +14,7 @@ import userEvent from "@testing-library/user-event"; import { mockPlatformPeg, stubClient } from "../../../../test-utils"; import AccessSecretStorageDialog from "../../../../../src/components/views/dialogs/security/AccessSecretStorageDialog"; -const securityKey = "EsTc WKmb ivvk jLS7 Y1NH 5CcQ mP1E JJwj B3Fd pFWm t4Dp dbyu"; +const recoveryKey = "EsTc WKmb ivvk jLS7 Y1NH 5CcQ mP1E JJwj B3Fd pFWm t4Dp dbyu"; describe("AccessSecretStorageDialog", () => { let mockClient: MatrixClient; @@ -29,11 +29,11 @@ describe("AccessSecretStorageDialog", () => { render(); }; - const enterSecurityKey = (placeholder = "Security Key"): void => { + const enterRecoveryKey = (placeholder = "Recovery Key"): void => { act(() => { fireEvent.change(screen.getByPlaceholderText(placeholder), { target: { - value: securityKey, + value: recoveryKey, }, }); // wait for debounce @@ -67,17 +67,17 @@ describe("AccessSecretStorageDialog", () => { renderComponent({ onFinished, checkPrivateKey }); // check that the input field is focused - expect(screen.getByPlaceholderText("Security Key")).toHaveFocus(); + expect(screen.getByPlaceholderText("Recovery Key")).toHaveFocus(); - await enterSecurityKey(); + await enterRecoveryKey(); await submitDialog(); expect(screen.getByText("Looks good!")).toBeInTheDocument(); - expect(checkPrivateKey).toHaveBeenCalledWith({ recoveryKey: securityKey }); - expect(onFinished).toHaveBeenCalledWith({ recoveryKey: securityKey }); + expect(checkPrivateKey).toHaveBeenCalledWith({ recoveryKey }); + expect(onFinished).toHaveBeenCalledWith({ recoveryKey }); }); - it("Notifies the user if they input an invalid Security Key", async () => { + it("Notifies the user if they input an invalid Recovery Key", async () => { const onFinished = jest.fn(); const checkPrivateKey = jest.fn().mockResolvedValue(true); renderComponent({ onFinished, checkPrivateKey }); @@ -86,11 +86,11 @@ describe("AccessSecretStorageDialog", () => { throw new Error("invalid key"); }); - await enterSecurityKey(); + await enterRecoveryKey(); await submitDialog(); expect(screen.getByText("Continue")).toBeDisabled(); - expect(screen.getByText("Invalid Security Key")).toBeInTheDocument(); + expect(screen.getByText("Invalid Recovery Key")).toBeInTheDocument(); }); it("Notifies the user if they input an invalid passphrase", async function () { @@ -110,8 +110,8 @@ describe("AccessSecretStorageDialog", () => { const checkPrivateKey = jest.fn().mockResolvedValue(false); renderComponent({ checkPrivateKey, keyInfo }); - await enterSecurityKey("Security Phrase"); - expect(screen.getByPlaceholderText("Security Phrase")).toHaveValue(securityKey); + await enterRecoveryKey("Security Phrase"); + expect(screen.getByPlaceholderText("Security Phrase")).toHaveValue(recoveryKey); await submitDialog(); await expect( @@ -141,11 +141,11 @@ describe("AccessSecretStorageDialog", () => { document.execCommand = jest.fn().mockReturnValue(true); jest.spyOn(mockClient.getCrypto()!, "createRecoveryKeyFromPassphrase").mockResolvedValue({ privateKey: new Uint8Array(), - encodedPrivateKey: securityKey, + encodedPrivateKey: recoveryKey, }); screen.getByRole("button", { name: "Continue" }).click(); - await screen.findByText(/Save your Security Key/); + await screen.findByText(/Save your Recovery Key/); screen.getByRole("button", { name: "Copy" }).click(); await screen.findByText("Copied!"); screen.getByRole("button", { name: "Continue" }).click(); diff --git a/test/unit-tests/components/views/dialogs/security/CreateSecretStorageDialog-test.tsx b/test/unit-tests/components/views/dialogs/security/CreateSecretStorageDialog-test.tsx index 703f574587..000f6efdb4 100644 --- a/test/unit-tests/components/views/dialogs/security/CreateSecretStorageDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/security/CreateSecretStorageDialog-test.tsx @@ -48,7 +48,7 @@ describe("CreateSecretStorageDialog", () => { expect(result.container).toMatchSnapshot(); await userEvent.click(result.getByRole("button", { name: "Continue" })); - await screen.findByText("Save your Security Key"); + await screen.findByText("Save your Recovery Key"); expect(result.container).toMatchSnapshot(); // Copy the key to enable the continue button await userEvent.click(screen.getByRole("button", { name: "Copy" })); @@ -66,7 +66,7 @@ describe("CreateSecretStorageDialog", () => { "Safeguard against losing access to encrypted messages & data by backing up encryption keys on your server.", ); await userEvent.click(screen.getByRole("button", { name: "Continue" })); - await screen.findByText("Save your Security Key"); + await screen.findByText("Save your Recovery Key"); await userEvent.click(screen.getByRole("button", { name: "Copy" })); await userEvent.click(screen.getByRole("button", { name: "Continue" })); @@ -108,7 +108,7 @@ describe("CreateSecretStorageDialog", () => { }); result.getByRole("button", { name: "Continue" }).click(); - await result.findByText(/Save your Security Key/); + await result.findByText(/Save your Recovery Key/); result.getByRole("button", { name: "Copy" }).click(); // Resetting should reset secret storage, cross signing, and key diff --git a/test/unit-tests/components/views/dialogs/security/RestoreKeyBackupDialog-test.tsx b/test/unit-tests/components/views/dialogs/security/RestoreKeyBackupDialog-test.tsx index 2860535984..e2ba7562f7 100644 --- a/test/unit-tests/components/views/dialogs/security/RestoreKeyBackupDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/security/RestoreKeyBackupDialog-test.tsx @@ -32,7 +32,7 @@ describe("", () => { it("should render", async () => { const { asFragment } = render(); - await waitFor(() => expect(screen.getByText("Enter Security Key")).toBeInTheDocument()); + await waitFor(() => expect(screen.getByText("Enter Recovery Key")).toBeInTheDocument()); expect(asFragment()).toMatchSnapshot(); }); @@ -41,19 +41,19 @@ describe("", () => { throw new Error("Invalid recovery key"); }); const { asFragment } = render(); - await waitFor(() => expect(screen.getByText("Enter Security Key")).toBeInTheDocument()); + await waitFor(() => expect(screen.getByText("Enter Recovery Key")).toBeInTheDocument()); await userEvent.type(screen.getByRole("textbox"), "invalid key"); - await waitFor(() => expect(screen.getByText("👎 Not a valid Security Key")).toBeInTheDocument()); + await waitFor(() => expect(screen.getByText("👎 Not a valid Recovery Key")).toBeInTheDocument()); expect(asFragment()).toMatchSnapshot(); }); it("should not raise an error when recovery is valid", async () => { const { asFragment } = render(); - await waitFor(() => expect(screen.getByText("Enter Security Key")).toBeInTheDocument()); + await waitFor(() => expect(screen.getByText("Enter Recovery Key")).toBeInTheDocument()); await userEvent.type(screen.getByRole("textbox"), "valid key"); - await waitFor(() => expect(screen.getByText("👍 This looks like a valid Security Key!")).toBeInTheDocument()); + await waitFor(() => expect(screen.getByText("👍 This looks like a valid Recovery Key!")).toBeInTheDocument()); expect(asFragment()).toMatchSnapshot(); }); @@ -79,7 +79,7 @@ describe("", () => { expect(asFragment()).toMatchSnapshot(); }); - it("should restore key backup when security key is filled by user", async () => { + it("should restore key backup when Recovery key is filled by user", async () => { jest.spyOn(matrixClient.getCrypto()!, "restoreKeyBackup") // Reject when trying to restore from cache .mockRejectedValueOnce(new Error("key backup not found")) @@ -87,9 +87,9 @@ describe("", () => { .mockResolvedValue(keyBackupRestoreResult); const { asFragment } = render(); - await waitFor(() => expect(screen.getByText("Enter Security Key")).toBeInTheDocument()); + await waitFor(() => expect(screen.getByText("Enter Recovery Key")).toBeInTheDocument()); - await userEvent.type(screen.getByRole("textbox"), "my security key"); + await userEvent.type(screen.getByRole("textbox"), "my recovery key"); await userEvent.click(screen.getByRole("button", { name: "Next" })); await waitFor(() => expect(screen.getByText("Successfully restored 1 keys")).toBeInTheDocument()); diff --git a/test/unit-tests/components/views/dialogs/security/__snapshots__/CreateSecretStorageDialog-test.tsx.snap b/test/unit-tests/components/views/dialogs/security/__snapshots__/CreateSecretStorageDialog-test.tsx.snap index a39ce29439..39573190e0 100644 --- a/test/unit-tests/components/views/dialogs/security/__snapshots__/CreateSecretStorageDialog-test.tsx.snap +++ b/test/unit-tests/components/views/dialogs/security/__snapshots__/CreateSecretStorageDialog-test.tsx.snap @@ -55,10 +55,10 @@ exports[`CreateSecretStorageDialog handles the happy path 1`] = ` - Generate a Security Key + Generate a Recovery Key
- We'll generate a Security Key for you to store somewhere safe, like a password manager or a safe. + We'll generate a Recovery Key for you to store somewhere safe, like a password manager or a safe.
- Use a secret phrase only you know, and optionally save a Security Key to use for backup. + Use a secret phrase only you know, and optionally save a Recovery Key to use for backup.
- Save your Security Key + Save your Recovery Key

- Store your Security Key somewhere safe, like a password manager or a safe, as it's used to safeguard your encrypted data. + Store your Recovery Key somewhere safe, like a password manager or a safe, as it's used to safeguard your encrypted data.

should display an error when recovery key is class="mx_Heading_h3 mx_Dialog_title" id="mx_BaseDialog_title" > - Enter Security Key + Enter Recovery Key
should display an error when recovery key is

- Access your secure message history and set up secure messaging by entering your Security Key. + Access your secure message history and set up secure messaging by entering your Recovery Key.

should display an error when recovery key is
- 👎 Not a valid Security Key + 👎 Not a valid Recovery Key
should display an error when recovery key is
- If you've forgotten your Security Key you can + If you've forgotten your Recovery Key you can
should not raise an error when recovery is v

- Access your secure message history and set up secure messaging by entering your Security Key. + Access your secure message history and set up secure messaging by entering your Recovery Key.

should not raise an error when recovery is v
- 👍 This looks like a valid Security Key! + 👍 This looks like a valid Recovery Key!
should not raise an error when recovery is v
- If you've forgotten your Security Key you can + If you've forgotten your Recovery Key you can
should render 1`] = `

- Access your secure message history and set up secure messaging by entering your Security Key. + Access your secure message history and set up secure messaging by entering your Recovery Key.

should render 1`] = `
- If you've forgotten your Security Key you can + If you've forgotten your Recovery Key you can