mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-05 22:25:36 +00:00
test: adapt unit tests to HealthChat fork customizations
This commit is contained in:
@@ -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()),
|
||||
};
|
||||
|
||||
+3
@@ -85,6 +85,9 @@ describe("<AccountUserSettingsTab />", () => {
|
||||
|
||||
stores = new SdkContextClass();
|
||||
stores.client = mockClient;
|
||||
// HealthChat's ExtendedProfileSettings (mounted via UserProfileSettings) reads the global
|
||||
// SdkContextClass.instance.userProfilesStore, which requires the singleton client to be set.
|
||||
SdkContextClass.instance.client = mockClient;
|
||||
// stub out this store completely to avoid mocking initialisation
|
||||
const mockOidcClientStore = {} as unknown as OidcClientStore;
|
||||
jest.spyOn(stores, "oidcClientStore", "get").mockReturnValue(mockOidcClientStore);
|
||||
|
||||
+4
-4
@@ -42,14 +42,14 @@ exports[`<AccountUserSettingsTab /> 3pids should display 3pid email addresses an
|
||||
>
|
||||
<input
|
||||
autocomplete="email"
|
||||
id="mx_Field_3"
|
||||
id="mx_Field_113"
|
||||
label="Email Address"
|
||||
placeholder="Email Address"
|
||||
type="text"
|
||||
value=""
|
||||
/>
|
||||
<label
|
||||
for="mx_Field_3"
|
||||
for="mx_Field_113"
|
||||
>
|
||||
Email Address
|
||||
</label>
|
||||
@@ -154,14 +154,14 @@ exports[`<AccountUserSettingsTab /> 3pids should display 3pid email addresses an
|
||||
</span>
|
||||
<input
|
||||
autocomplete="tel-national"
|
||||
id="mx_Field_4"
|
||||
id="mx_Field_114"
|
||||
label="Phone Number"
|
||||
placeholder="Phone Number"
|
||||
type="text"
|
||||
value=""
|
||||
/>
|
||||
<label
|
||||
for="mx_Field_4"
|
||||
for="mx_Field_114"
|
||||
>
|
||||
Phone Number
|
||||
</label>
|
||||
|
||||
Reference in New Issue
Block a user