Hopefully fix manual device verification test (#31175)

Looks like it's failing to clear modals between tests
This commit is contained in:
David Baker 2025-11-05 10:19:21 +00:00 committed by GitHub
parent b8e7c725e2
commit d9e3aa52e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,7 +11,7 @@ import { act, fireEvent, render, screen, waitFor } from "jest-matrix-react";
import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { type MatrixClient } from "matrix-js-sdk/src/matrix";
import { DeviceVerificationStatus } from "matrix-js-sdk/src/crypto-api"; import { DeviceVerificationStatus } from "matrix-js-sdk/src/crypto-api";
import { stubClient } from "../../../../test-utils"; import { clearAllModals, stubClient } from "../../../../test-utils";
import { ManualDeviceKeyVerificationDialog } from "../../../../../src/components/views/dialogs/ManualDeviceKeyVerificationDialog"; import { ManualDeviceKeyVerificationDialog } from "../../../../../src/components/views/dialogs/ManualDeviceKeyVerificationDialog";
describe("ManualDeviceKeyVerificationDialog", () => { describe("ManualDeviceKeyVerificationDialog", () => {
@ -21,9 +21,10 @@ describe("ManualDeviceKeyVerificationDialog", () => {
return render(<ManualDeviceKeyVerificationDialog onFinished={onFinished} />); return render(<ManualDeviceKeyVerificationDialog onFinished={onFinished} />);
} }
beforeEach(() => { beforeEach(async () => {
mockClient = stubClient(); mockClient = stubClient();
mockExistingDevices(); mockExistingDevices();
await clearAllModals();
}); });
it("should render correctly", () => { it("should render correctly", () => {