diff --git a/cypress/global.d.ts b/cypress/global.d.ts index 5c479424ba6..99943e13be3 100644 --- a/cypress/global.d.ts +++ b/cypress/global.d.ts @@ -28,13 +28,12 @@ import type { } from "matrix-js-sdk/src/matrix"; import type { MatrixDispatcher } from "../src/dispatcher/dispatcher"; import type PerformanceMonitor from "../src/performance"; -import type SettingsStore from "../src/settings/SettingsStore"; declare global { // eslint-disable-next-line @typescript-eslint/no-namespace namespace Cypress { interface ApplicationWindow { - mxSettingsStore: typeof SettingsStore; + mxSettingsStore: any; // XXX: Importing SettingsStore causes a bunch of type lint errors mxMatrixClientPeg: { matrixClient?: MatrixClient; }; diff --git a/cypress/support/settings.ts b/cypress/support/settings.ts index cebbec6a761..4387a3c330d 100644 --- a/cypress/support/settings.ts +++ b/cypress/support/settings.ts @@ -18,7 +18,6 @@ limitations under the License. import Chainable = Cypress.Chainable; import type { SettingLevel } from "../../src/settings/SettingLevel"; -import SettingsStore from "../../src/settings/SettingsStore"; declare global { // eslint-disable-next-line @typescript-eslint/no-namespace @@ -27,7 +26,7 @@ declare global { /** * Returns the SettingsStore */ - getSettingsStore(): Chainable; + getSettingsStore(): Chainable; // XXX: Importing SettingsStore causes a bunch of type lint errors /** * Open the top left user menu, returning a handle to the resulting context menu. */ @@ -101,7 +100,7 @@ declare global { } } -Cypress.Commands.add("getSettingsStore", (): Chainable => { +Cypress.Commands.add("getSettingsStore", (): Chainable => { return cy.window({ log: false }).then(win => win.mxSettingsStore); }); @@ -111,14 +110,14 @@ Cypress.Commands.add("setSettingValue", ( level: SettingLevel, value: any, ): Chainable => { - return cy.getSettingsStore().then(async (store: typeof SettingsStore) => { + return cy.getSettingsStore().then(async (store: any) => { return store.setValue(name, roomId, level, value); }); }); Cypress.Commands.add("getSettingValue", (name: string, roomId?: string): Chainable => { - return cy.getSettingsStore().then((store: typeof SettingsStore) => { - return store.getValue(name, roomId); + return cy.getSettingsStore().then((store: any) => { + return store.getValue(name, roomId); }); });