Rename "security key" into "recovery key" (#29217)

* feat(crypto): rename "security key" into "recovery key" in lang file

* test(crypto): rename "security key" into "recovery key" in test files

* test(e2e crypto): rename "security key" into "recovery key" in test files

* doc(crypto): rename "security key" into "recovery key"
This commit is contained in:
Florian D
2025-02-10 16:52:39 +00:00
committed by GitHub
parent 4de9fe60ae
commit 047e8e8a9c
15 changed files with 93 additions and 93 deletions
@@ -32,7 +32,7 @@ describe("<RestoreKeyBackupDialog />", () => {
it("should render", async () => {
const { asFragment } = render(<RestoreKeyBackupDialog onFinished={jest.fn()} />);
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("<RestoreKeyBackupDialog />", () => {
throw new Error("Invalid recovery key");
});
const { asFragment } = render(<RestoreKeyBackupDialog onFinished={jest.fn()} />);
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(<RestoreKeyBackupDialog onFinished={jest.fn()} />);
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("<RestoreKeyBackupDialog />", () => {
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("<RestoreKeyBackupDialog />", () => {
.mockResolvedValue(keyBackupRestoreResult);
const { asFragment } = render(<RestoreKeyBackupDialog onFinished={jest.fn()} />);
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());