1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-08-09 08:42:50 +03:00

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

View File

@@ -112,7 +112,7 @@ describe("MessagePanel", function () {
return arg === "showDisplaynameChanges";
});
DMRoomMap.makeShared();
DMRoomMap.makeShared(client);
});
afterEach(function () {

View File

@@ -91,7 +91,7 @@ describe("PipContainer", () => {
stubClient();
client = mocked(MatrixClientPeg.get());
DMRoomMap.makeShared();
DMRoomMap.makeShared(client);
room = new Room("!1:example.org", client, "@alice:example.org", {
pendingEventOrdering: PendingEventOrdering.Detached,

View File

@@ -48,7 +48,7 @@ describe("RightPanel", () => {
beforeEach(() => {
stubClient();
cli = mocked(MatrixClientPeg.get());
DMRoomMap.makeShared();
DMRoomMap.makeShared(cli);
context = new SdkContextClass();
context.client = cli;
RightPanel = wrapInSdkContext(RightPanelBase, context);

View File

@@ -83,7 +83,7 @@ describe("RoomView", () => {
room.on(RoomEvent.Timeline, (...args) => cli.emit(RoomEvent.Timeline, ...args));
room.on(RoomEvent.TimelineReset, (...args) => cli.emit(RoomEvent.TimelineReset, ...args));
DMRoomMap.makeShared();
DMRoomMap.makeShared(cli);
stores = new SdkContextClass();
stores.client = cli;
stores.rightPanelStore.useUnitTestClient(cli);
@@ -457,7 +457,7 @@ describe("RoomView", () => {
});
it("the last Jitsi widget should be removed", () => {
expect(WidgetUtils.setRoomWidget).toHaveBeenCalledWith(room.roomId, widget2Id);
expect(WidgetUtils.setRoomWidget).toHaveBeenCalledWith(cli, room.roomId, widget2Id);
});
});

View File

@@ -131,7 +131,7 @@ describe("ThreadView", () => {
rootEvent = res.rootEvent;
DMRoomMap.makeShared();
DMRoomMap.makeShared(mockClient);
jest.spyOn(DMRoomMap.shared(), "getUserIdForRoomId").mockReturnValue(SENDER);
});