mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-24 09:08:18 +00:00
Add MatrixClientPeg::safeGet and use it in tests (#10985)
This commit is contained in:
committed by
GitHub
parent
c47b587225
commit
6b46d6e4f8
@@ -107,6 +107,7 @@ describe("<SpaceSettingsVisibilityTab />", () => {
|
||||
|
||||
(mockMatrixClient.sendStateEvent as jest.Mock).mockClear().mockResolvedValue({});
|
||||
MatrixClientPeg.get = jest.fn().mockReturnValue(mockMatrixClient);
|
||||
MatrixClientPeg.safeGet = jest.fn().mockReturnValue(mockMatrixClient);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
||||
@@ -39,8 +39,8 @@ jest.mock("../../../../src/stores/spaces/SpaceStore", () => {
|
||||
|
||||
describe("SpaceButton", () => {
|
||||
stubClient();
|
||||
const space = mkRoom(MatrixClientPeg.get(), "!1:example.org");
|
||||
DMRoomMap.makeShared(MatrixClientPeg.get());
|
||||
const space = mkRoom(MatrixClientPeg.safeGet(), "!1:example.org");
|
||||
DMRoomMap.makeShared(MatrixClientPeg.safeGet());
|
||||
|
||||
const dispatchSpy = jest.spyOn(defaultDispatcher, "dispatch");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user