diff --git a/test/stores/widgets/StopGapWidgetDriver-test.ts b/test/stores/widgets/StopGapWidgetDriver-test.ts index efe0fafe554..282ce23d6fa 100644 --- a/test/stores/widgets/StopGapWidgetDriver-test.ts +++ b/test/stores/widgets/StopGapWidgetDriver-test.ts @@ -49,6 +49,7 @@ import { StopGapWidgetDriver } from "../../../src/stores/widgets/StopGapWidgetDr import { stubClient } from "../../test-utils"; import { ModuleRunner } from "../../../src/modules/ModuleRunner"; import dis from "../../../src/dispatcher/dispatcher"; +import Modal from "../../../src/Modal"; import SettingsStore from "../../../src/settings/SettingsStore"; describe("StopGapWidgetDriver", () => { @@ -68,6 +69,10 @@ describe("StopGapWidgetDriver", () => { "!1:example.org", ); + jest.spyOn(Modal, "createDialog").mockImplementation(() => { + throw new Error("Should not have to create a dialog"); + }); + beforeEach(() => { stubClient(); client = mocked(MatrixClientPeg.safeGet()); @@ -127,7 +132,6 @@ describe("StopGapWidgetDriver", () => { "org.matrix.msc4157.update_delayed_event", ]); - // As long as this resolves, we'll know that it didn't try to pop up a modal const approvedCapabilities = await driver.validateCapabilities(requestedCapabilities); expect(approvedCapabilities).toEqual(requestedCapabilities); });