Return RLS instance through function to avoid import side effect (#31091)
* Attach function that returns instance So that just importing this file does not create a RLS instance. * Fix jest test
This commit is contained in:
Vendored
+1
-1
@@ -98,7 +98,7 @@ declare global {
|
|||||||
mxToastStore: ToastStore;
|
mxToastStore: ToastStore;
|
||||||
mxDeviceListener: DeviceListener;
|
mxDeviceListener: DeviceListener;
|
||||||
mxRoomListStore: RoomListStore;
|
mxRoomListStore: RoomListStore;
|
||||||
mxRoomListStoreV3: RoomListStoreV3Class;
|
getRoomListStoreV3: () => RoomListStoreV3Class;
|
||||||
mxRoomListLayoutStore: RoomListLayoutStore;
|
mxRoomListLayoutStore: RoomListLayoutStore;
|
||||||
mxPlatformPeg: PlatformPeg;
|
mxPlatformPeg: PlatformPeg;
|
||||||
mxIntegrationManagers: typeof IntegrationManagers;
|
mxIntegrationManagers: typeof IntegrationManagers;
|
||||||
|
|||||||
@@ -373,4 +373,4 @@ export default class RoomListStoreV3 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.mxRoomListStoreV3 = RoomListStoreV3.instance;
|
window.getRoomListStoreV3 = () => RoomListStoreV3.instance;
|
||||||
|
|||||||
@@ -48,6 +48,9 @@ describe("useRoomListHeaderViewModel", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
matrixClient = stubClient();
|
matrixClient = stubClient();
|
||||||
space = mkStubRoom("spaceId", "spaceName", matrixClient);
|
space = mkStubRoom("spaceId", "spaceName", matrixClient);
|
||||||
|
jest.spyOn(SettingsStore, "getValue").mockImplementation((name: string): any => {
|
||||||
|
if (name === "RoomList.preferredSorting") return SortingAlgorithm.Recency;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user