Catch errors after syncing recovery (#29691)
* Allow setting the Encryption settings tab to any initial state * Add a variant to the reset flow for 'sync_failed' * Catch errors after syncing recovery Fixes #29229 * fixup! Allow setting the Encryption settings tab to any initial state * fixup! Add a variant to the reset flow for 'sync_failed' * Move docs for identity panel variants to ResetIdentityPanelVariant
This commit is contained in:
@@ -151,18 +151,30 @@ describe("<EncryptionUserSettingsTab />", () => {
|
||||
expect(asFragment()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("should enter reset flow when showResetIdentity is set", async () => {
|
||||
it("should enter 'Forgot recovery' flow when initialState is set to 'reset_identity_forgot'", async () => {
|
||||
jest.spyOn(matrixClient.getCrypto()!, "getActiveSessionBackupVersion").mockResolvedValue("1");
|
||||
|
||||
renderComponent({ initialState: "reset_identity_forgot" });
|
||||
|
||||
await expect(
|
||||
expect(
|
||||
await screen.findByRole("heading", {
|
||||
name: "Forgot your recovery key? You’ll need to reset your identity.",
|
||||
}),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
it("should do 'Failed to sync' reset flow when initialState is set to 'reset_identity_sync_failed'", async () => {
|
||||
jest.spyOn(matrixClient.getCrypto()!, "getActiveSessionBackupVersion").mockResolvedValue("1");
|
||||
|
||||
renderComponent({ initialState: "reset_identity_sync_failed" });
|
||||
|
||||
expect(
|
||||
await screen.findByRole("heading", {
|
||||
name: "Failed to sync key storage. You need to reset your identity.",
|
||||
}),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
it("should update when key backup status event is fired", async () => {
|
||||
jest.spyOn(matrixClient.getCrypto()!, "getActiveSessionBackupVersion").mockResolvedValue("1");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user