Separate out SDKContext (#34053)
* Separate out SDKContext ...from SDKContextClass, as the comments hopefully explain. Also make the captitalisation consistent. * Adding the new file usually helps too * Fix import * More comment * Update the various imports of SDKContextClass * Also fix case of TestSDKContext * Update the mock
This commit is contained in:
@@ -32,7 +32,7 @@ import HTMLExporter from "../../../../src/utils/exportUtils/HtmlExport";
|
||||
import DMRoomMap from "../../../../src/utils/DMRoomMap";
|
||||
import { mediaFromMxc } from "../../../../src/customisations/Media";
|
||||
import SettingsStore from "../../../../src/settings/SettingsStore";
|
||||
import { SdkContextClass } from "../../../../src/contexts/SDKContext.ts";
|
||||
import { SDKContextClass } from "../../../../src/contexts/SDKContextClass";
|
||||
|
||||
jest.mock("jszip");
|
||||
jest.mock("../../../../src/settings/SettingsStore");
|
||||
@@ -111,7 +111,7 @@ describe("HTMLExport", () => {
|
||||
jest.setSystemTime(REPEATABLE_DATE);
|
||||
|
||||
client = stubClient() as jest.Mocked<MatrixClient>;
|
||||
SdkContextClass.instance.client = client;
|
||||
SDKContextClass.instance.client = client;
|
||||
DMRoomMap.makeShared(client);
|
||||
|
||||
room = new Room("!myroom:example.org", client, "@me:example.org");
|
||||
|
||||
@@ -16,7 +16,7 @@ import defaultDispatcher from "../../../src/dispatcher/dispatcher";
|
||||
import { type ViewRoomPayload } from "../../../src/dispatcher/payloads/ViewRoomPayload";
|
||||
import { Action } from "../../../src/dispatcher/actions";
|
||||
import { leaveRoomBehaviour } from "../../../src/utils/leave-behaviour";
|
||||
import { SdkContextClass } from "../../../src/contexts/SDKContext";
|
||||
import { SDKContextClass } from "../../../src/contexts/SDKContextClass";
|
||||
import DMRoomMap from "../../../src/utils/DMRoomMap";
|
||||
import SpaceStore from "../../../src/stores/spaces/SpaceStore";
|
||||
import { MetaSpace } from "../../../src/stores/spaces";
|
||||
@@ -27,7 +27,7 @@ import { type Call } from "../../../src/models/Call";
|
||||
import LegacyCallHandler from "../../../src/LegacyCallHandler";
|
||||
|
||||
describe("leaveRoomBehaviour", () => {
|
||||
SdkContextClass.instance.constructEagerStores(); // Initialize RoomViewStore
|
||||
SDKContextClass.instance.constructEagerStores(); // Initialize RoomViewStore
|
||||
|
||||
let client: Mocked<MatrixClient>;
|
||||
let room: Mocked<Room>;
|
||||
|
||||
Reference in New Issue
Block a user