You've already forked matrix-react-sdk
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:
committed by
GitHub
parent
a0c2676c38
commit
30429df948
@@ -112,7 +112,7 @@ describe("MessagePanel", function () {
|
||||
return arg === "showDisplaynameChanges";
|
||||
});
|
||||
|
||||
DMRoomMap.makeShared();
|
||||
DMRoomMap.makeShared(client);
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
|
@@ -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,
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -131,7 +131,7 @@ describe("ThreadView", () => {
|
||||
|
||||
rootEvent = res.rootEvent;
|
||||
|
||||
DMRoomMap.makeShared();
|
||||
DMRoomMap.makeShared(mockClient);
|
||||
jest.spyOn(DMRoomMap.shared(), "getUserIdForRoomId").mockReturnValue(SENDER);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user