Eliminate the use of MatrixClientPeg in utils (#10910)

This commit is contained in:
Michael Telatynski
2023-05-23 16:24:12 +01:00
committed by GitHub
parent a0c2676c38
commit 30429df948
108 changed files with 409 additions and 325 deletions
@@ -37,7 +37,7 @@ describe("RightPanelStore", () => {
beforeEach(() => {
stubClient();
cli = mocked(MatrixClientPeg.get());
DMRoomMap.makeShared();
DMRoomMap.makeShared(cli);
// Make sure we start with a clean store
store.reset();
+2 -2
View File
@@ -162,7 +162,7 @@ describe("RoomListStore", () => {
room1.updateMyMembership("join");
room2.updateMyMembership("join");
room3.updateMyMembership("join");
DMRoomMap.makeShared();
DMRoomMap.makeShared(client);
const { store } = createStore();
client.getVisibleRooms = jest.fn().mockReturnValue([room1, room2, room3]);
@@ -274,7 +274,7 @@ describe("RoomListStore", () => {
it("Passes the feature flag on to the client when asking for visible rooms", () => {
// Given a store that we can ask for a room list
DMRoomMap.makeShared();
DMRoomMap.makeShared(client);
const { store } = createStore();
client.getVisibleRooms = jest.fn().mockReturnValue([]);
@@ -41,7 +41,7 @@ describe("Algorithm", () => {
beforeEach(() => {
stubClient();
client = mocked(MatrixClientPeg.get());
DMRoomMap.makeShared();
DMRoomMap.makeShared(client);
algorithm = new Algorithm();
algorithm.start();