Eliminate the use of MatrixClientPeg in utils (#10910)
This commit is contained in:
parent
a0c2676c38
commit
30429df948
108 changed files with 409 additions and 325 deletions
|
@ -97,7 +97,7 @@ describe("<EditMessageComposer/>", () => {
|
|||
|
||||
userEvent.setup();
|
||||
|
||||
DMRoomMap.makeShared();
|
||||
DMRoomMap.makeShared(mockClient);
|
||||
|
||||
jest.spyOn(Autocompleter.prototype, "getCompletions").mockResolvedValue([
|
||||
{
|
||||
|
|
|
@ -47,7 +47,7 @@ describe("NewRoomIntro", () => {
|
|||
|
||||
beforeAll(() => {
|
||||
client = stubClient();
|
||||
DMRoomMap.makeShared();
|
||||
DMRoomMap.makeShared(client);
|
||||
});
|
||||
|
||||
describe("for a DM Room", () => {
|
||||
|
|
|
@ -112,7 +112,7 @@ describe("RoomHeader", () => {
|
|||
[MediaDeviceKindEnum.AudioOutput]: [],
|
||||
});
|
||||
|
||||
DMRoomMap.makeShared();
|
||||
DMRoomMap.makeShared(client);
|
||||
jest.spyOn(DMRoomMap.shared(), "getUserIdForRoomId").mockReturnValue(carol.userId);
|
||||
});
|
||||
|
||||
|
@ -761,7 +761,7 @@ function createRoom(info: IRoomCreationInfo) {
|
|||
};
|
||||
}
|
||||
|
||||
DMRoomMap.makeShared().start();
|
||||
DMRoomMap.makeShared(client).start();
|
||||
|
||||
const room = new Room(roomId, client, userId, {
|
||||
pendingEventOrdering: PendingEventOrdering.Detached,
|
||||
|
|
|
@ -33,8 +33,9 @@ jest.mock("../../../../src/IdentityAuthClient", () => {
|
|||
jest.useRealTimers();
|
||||
|
||||
const createRoom = (roomId: string, userId: string): Room => {
|
||||
const newRoom = new Room(roomId, MatrixClientPeg.get(), userId, {});
|
||||
DMRoomMap.makeShared().start();
|
||||
const cli = MatrixClientPeg.get();
|
||||
const newRoom = new Room(roomId, cli, userId, {});
|
||||
DMRoomMap.makeShared(cli).start();
|
||||
return newRoom;
|
||||
};
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ describe("RoomPreviewCard", () => {
|
|||
stubClient();
|
||||
client = mocked(MatrixClientPeg.get());
|
||||
client.getUserId.mockReturnValue("@alice:example.org");
|
||||
DMRoomMap.makeShared();
|
||||
DMRoomMap.makeShared(client);
|
||||
|
||||
room = new Room("!1:example.org", client, "@alice:example.org", {
|
||||
pendingEventOrdering: PendingEventOrdering.Detached,
|
||||
|
|
|
@ -90,7 +90,7 @@ describe("RoomTile", () => {
|
|||
|
||||
client = mocked(stubClient());
|
||||
sdkContext.client = client;
|
||||
DMRoomMap.makeShared();
|
||||
DMRoomMap.makeShared(client);
|
||||
|
||||
room = new Room("!1:example.org", client, "@alice:example.org", {
|
||||
pendingEventOrdering: PendingEventOrdering.Detached,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue