test: adapt unit tests to HealthChat fork customizations

This commit is contained in:
2026-06-06 15:14:12 +02:00
parent 2685821bdc
commit d72b973d01
9 changed files with 36 additions and 58 deletions
@@ -18,6 +18,7 @@ import { mkStubRoom, stubClient } from "../../../../test-utils";
import { ToastContext, type ToastRack } from "../../../../../src/contexts/ToastContext";
import { OwnProfileStore } from "../../../../../src/stores/OwnProfileStore";
import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext";
import { SdkContextClass } from "../../../../../src/contexts/SDKContext";
import Modal from "../../../../../src/Modal";
interface MockedAvatarSettingProps {
@@ -86,6 +87,9 @@ describe("ProfileSettings", () => {
beforeEach(() => {
client = stubClient();
// HealthChat's ExtendedProfileSettings reads the global SdkContextClass.instance.userProfilesStore,
// which requires the singleton client to be set (it is, on login, in the real app).
SdkContextClass.instance.client = client;
toastRack = {
displayToast: jest.fn().mockReturnValue(jest.fn()),
};