diff --git a/playwright/e2e/settings/appearance-user-settings-tab.spec.ts b/playwright/e2e/settings/appearance-user-settings-tab.spec.ts index df091f45a8c..7e16d739558 100644 --- a/playwright/e2e/settings/appearance-user-settings-tab.spec.ts +++ b/playwright/e2e/settings/appearance-user-settings-tab.spec.ts @@ -25,8 +25,6 @@ test.describe("Appearance user settings tab", () => { test("should be rendered properly", async ({ page, user, app }) => { const tab = await app.settings.openUserSettings("Appearance"); - await expect(tab.getByRole("heading", { name: "Customise your appearance" })).toBeVisible(); - // Click "Show advanced" link button await tab.getByRole("button", { name: "Show advanced" }).click(); diff --git a/playwright/snapshots/settings/appearance-user-settings-tab.spec.ts/appearance-tab-linux.png b/playwright/snapshots/settings/appearance-user-settings-tab.spec.ts/appearance-tab-linux.png index e5680339f4b..b7fea971922 100644 Binary files a/playwright/snapshots/settings/appearance-user-settings-tab.spec.ts/appearance-tab-linux.png and b/playwright/snapshots/settings/appearance-user-settings-tab.spec.ts/appearance-tab-linux.png differ diff --git a/playwright/snapshots/settings/appearance-user-settings-tab.spec.ts/window-12px-linux.png b/playwright/snapshots/settings/appearance-user-settings-tab.spec.ts/window-12px-linux.png index ee9eca22836..3247abd7c1b 100644 Binary files a/playwright/snapshots/settings/appearance-user-settings-tab.spec.ts/window-12px-linux.png and b/playwright/snapshots/settings/appearance-user-settings-tab.spec.ts/window-12px-linux.png differ diff --git a/playwright/snapshots/settings/general-user-settings-tab.spec.ts/general-linux.png b/playwright/snapshots/settings/general-user-settings-tab.spec.ts/general-linux.png index f0b18bc950a..e11ef9c4101 100644 Binary files a/playwright/snapshots/settings/general-user-settings-tab.spec.ts/general-linux.png and b/playwright/snapshots/settings/general-user-settings-tab.spec.ts/general-linux.png differ diff --git a/playwright/snapshots/settings/preferences-user-settings-tab.spec.ts/Preferences-user-settings-tab-should-be-rendered-properly-1-linux.png b/playwright/snapshots/settings/preferences-user-settings-tab.spec.ts/Preferences-user-settings-tab-should-be-rendered-properly-1-linux.png index 02ce908efa5..e5d1ddef4f8 100644 Binary files a/playwright/snapshots/settings/preferences-user-settings-tab.spec.ts/Preferences-user-settings-tab-should-be-rendered-properly-1-linux.png and b/playwright/snapshots/settings/preferences-user-settings-tab.spec.ts/Preferences-user-settings-tab-should-be-rendered-properly-1-linux.png differ diff --git a/src/components/views/dialogs/BaseDialog.tsx b/src/components/views/dialogs/BaseDialog.tsx index 1b160150f76..66f6c9e0953 100644 --- a/src/components/views/dialogs/BaseDialog.tsx +++ b/src/components/views/dialogs/BaseDialog.tsx @@ -53,7 +53,7 @@ interface IProps { "top"?: React.ReactNode; // Title for the dialog. - "title"?: JSX.Element | string; + "title"?: React.ReactNode; // Specific aria label to use, if not provided will set aria-labelledBy to mx_Dialog_title "aria-label"?: string; diff --git a/src/components/views/dialogs/InviteDialog.tsx b/src/components/views/dialogs/InviteDialog.tsx index 58d2d28a11e..bb81d7a05f0 100644 --- a/src/components/views/dialogs/InviteDialog.tsx +++ b/src/components/views/dialogs/InviteDialog.tsx @@ -1536,7 +1536,7 @@ export default class InviteDialog extends React.PureComponent - tabs={tabs} activeTabId={this.state.currentTabId} tabLocation={TabLocation.TOP} diff --git a/src/components/views/dialogs/UserSettingsDialog.tsx b/src/components/views/dialogs/UserSettingsDialog.tsx index 2b28e423ed3..f5d45bca951 100644 --- a/src/components/views/dialogs/UserSettingsDialog.tsx +++ b/src/components/views/dialogs/UserSettingsDialog.tsx @@ -45,6 +45,38 @@ interface IProps { onFinished(): void; } +function titleForTabID(tabId: UserTab): React.ReactNode { + const subs = { + strong: (sub: string) => {sub}, + }; + switch (tabId) { + case UserTab.General: + return _t("settings|general|dialog_title", undefined, subs); + case UserTab.SessionManager: + return _t("settings|sessions|dialog_title", undefined, subs); + case UserTab.Appearance: + return _t("settings|appearance|dialog_title", undefined, subs); + case UserTab.Notifications: + return _t("settings|notifications|dialog_title", undefined, subs); + case UserTab.Preferences: + return _t("settings|preferences|dialog_title", undefined, subs); + case UserTab.Keyboard: + return _t("settings|keyboard|dialog_title", undefined, subs); + case UserTab.Sidebar: + return _t("settings|sidebar|dialog_title", undefined, subs); + case UserTab.Voice: + return _t("settings|voip|dialog_title", undefined, subs); + case UserTab.Security: + return _t("settings|security|dialog_title", undefined, subs); + case UserTab.Labs: + return _t("settings|labs|dialog_title", undefined, subs); + case UserTab.Mjolnir: + return _t("settings|labs_mjolnir|dialog_title", undefined, subs); + case UserTab.Help: + return _t("setting|help_about|dialog_title", undefined, subs); + } +} + export default function UserSettingsDialog(props: IProps): JSX.Element { const voipEnabled = useSettingValue(UIFeature.Voip); const mjolnirEnabled = useSettingValue("feature_mjolnir"); @@ -184,7 +216,7 @@ export default function UserSettingsDialog(props: IProps): JSX.Element { className="mx_UserSettingsDialog" hasCancel={true} onFinished={props.onFinished} - title={_t("common|settings")} + title={titleForTabID(activeTabId)} >
)} - +
{ - heading: string | React.ReactNode; + heading?: string | React.ReactNode; children?: React.ReactNode; } +function renderHeading(heading: string | React.ReactNode | undefined): React.ReactNode | undefined { + switch (typeof heading) { + case "string": + return ( + + {heading} + + ); + case "undefined": + return undefined; + default: + return heading; + } +} + /** * A section of settings content * A SettingsTab may contain one or more SettingsSections @@ -43,13 +58,7 @@ export interface SettingsSectionProps extends HTMLAttributes { */ export const SettingsSection: React.FC = ({ className, heading, children, ...rest }) => (
- {typeof heading === "string" ? ( - - {heading} - - ) : ( - <>{heading} - )} + {renderHeading(heading)}
{children}
); diff --git a/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx b/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx index 9408274e9bb..99f5a51c3b2 100644 --- a/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx @@ -32,7 +32,7 @@ import ThemeChoicePanel from "../../ThemeChoicePanel"; import ImageSizePanel from "../../ImageSizePanel"; import SettingsTab from "../SettingsTab"; import { SettingsSection } from "../../shared/SettingsSection"; -import SettingsSubsection, { SettingsSubsectionText } from "../../shared/SettingsSubsection"; +import SettingsSubsection from "../../shared/SettingsSubsection"; import MatrixClientContext from "../../../../../contexts/MatrixClientContext"; interface IProps {} @@ -152,12 +152,9 @@ export default class AppearanceUserSettingsTab extends React.Component - - {_t("settings|appearance|subheading", { brand })} + - + {this.renderAccountSection()} {this.renderLanguageSection()} diff --git a/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx b/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx index c8221b2df47..2bf2c0f6042 100644 --- a/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx @@ -264,7 +264,7 @@ export default class HelpUserSettingsTab extends React.Component return ( - + {bugReportingSection} diff --git a/src/components/views/settings/tabs/user/KeyboardUserSettingsTab.tsx b/src/components/views/settings/tabs/user/KeyboardUserSettingsTab.tsx index 7a856e06273..ea3a75e8f34 100644 --- a/src/components/views/settings/tabs/user/KeyboardUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/KeyboardUserSettingsTab.tsx @@ -73,7 +73,7 @@ const KeyboardShortcutSection: React.FC = ({ cate const KeyboardUserSettingsTab: React.FC = () => { return ( - + {visibleCategories.map(([categoryName, category]) => { return ( diff --git a/src/components/views/settings/tabs/user/MjolnirUserSettingsTab.tsx b/src/components/views/settings/tabs/user/MjolnirUserSettingsTab.tsx index 7ec29d43662..29466fc57e7 100644 --- a/src/components/views/settings/tabs/user/MjolnirUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/MjolnirUserSettingsTab.tsx @@ -254,7 +254,7 @@ export default class MjolnirUserSettingsTab extends React.Component<{}, IState> return ( - + {_t("labs_mjolnir|advanced_warning")}

{_t("labs_mjolnir|explainer_1", { brand }, { code: (s) => {s} })}

diff --git a/src/components/views/settings/tabs/user/NotificationUserSettingsTab.tsx b/src/components/views/settings/tabs/user/NotificationUserSettingsTab.tsx index 0a00c32ca1f..841babf979e 100644 --- a/src/components/views/settings/tabs/user/NotificationUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/NotificationUserSettingsTab.tsx @@ -16,7 +16,6 @@ limitations under the License. import React from "react"; -import { _t } from "../../../../../languageHandler"; import { Features } from "../../../../../settings/Settings"; import SettingsStore from "../../../../../settings/SettingsStore"; import Notifications from "../../Notifications"; @@ -33,7 +32,7 @@ export default class NotificationUserSettingsTab extends React.Component { {newNotificationSettingsEnabled ? ( ) : ( - + )} diff --git a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx index 6758519eafa..6df2a1a03c5 100644 --- a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx @@ -145,7 +145,7 @@ export default class PreferencesUserSettingsTab extends React.Component - + {roomListSettings.length > 0 && ( {this.renderGroup(roomListSettings)} diff --git a/src/components/views/settings/tabs/user/SessionManagerTab.tsx b/src/components/views/settings/tabs/user/SessionManagerTab.tsx index c711b7e39e5..ec1d658b5b9 100644 --- a/src/components/views/settings/tabs/user/SessionManagerTab.tsx +++ b/src/components/views/settings/tabs/user/SessionManagerTab.tsx @@ -284,7 +284,7 @@ const SessionManagerTab: React.FC = () => { return ( - + { return ( - + { return ( - + {requestButton} {speakerDropdown} diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index d1f4016aafd..9423801774a 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -2395,6 +2395,7 @@ "brand_version": "%(brand)s version:", "clear_cache_reload": "Clear cache and reload", "crypto_version": "Crypto version:", + "dialog_title": "Settings: Help & About", "help_link": "For help with using %(brand)s, click here.", "homeserver": "Homeserver is %(homeserverUrl)s", "identity_server": "Identity server is %(identityServerUrl)s", @@ -2417,15 +2418,14 @@ "custom_theme_invalid": "Invalid theme schema.", "custom_theme_success": "Theme added!", "custom_theme_url": "Custom theme URL", + "dialog_title": "Settings: Appearance", "font_size": "Font size", "font_size_default": "%(fontSize)s (default)", - "heading": "Customise your appearance", "image_size_default": "Default", "image_size_large": "Large", "layout_bubbles": "Message bubbles", "layout_irc": "IRC (Experimental)", "match_system_theme": "Match system theme", - "subheading": "Appearance Settings only affect this %(brand)s session.", "timeline_image_size": "Image size in the timeline", "use_high_contrast": "Use high contrast" }, @@ -2467,6 +2467,7 @@ "deactivate_confirm_erase_label": "Hide my messages from new joiners", "deactivate_section": "Deactivate Account", "deactivate_warning": "Deactivating your account is a permanent action — be careful!", + "dialog_title": "Settings: General", "discovery_email_empty": "Discovery options will appear once you have added an email above.", "discovery_email_verification_instructions": "Verify the link in your inbox", "discovery_msisdn_empty": "Discovery options will appear once you have added a phone number above.", @@ -2574,12 +2575,20 @@ "phrase_strong_enough": "Great! This passphrase looks strong enough" }, "keyboard": { + "dialog_title": "Settings: Keyboard", "title": "Keyboard" }, + "labs": { + "dialog_title": "Settings: Labs" + }, + "labs_mjolnir": { + "dialog_title": "Settings: Ignored Users" + }, "notifications": { "default_setting_description": "This setting will be applied by default to all your rooms.", "default_setting_section": "I want to be notified for (Default Setting)", "desktop_notification_message_preview": "Show message preview in desktop notification", + "dialog_title": "Settings: Notifications", "email_description": "Receive an email summary of missed notifications", "email_section": "Email summary", "email_select": "Select which emails you want to send summaries to. Manage your emails in .", @@ -2638,6 +2647,7 @@ "code_blocks_heading": "Code blocks", "compact_modern": "Use a more compact 'Modern' layout", "composer_heading": "Composer", + "dialog_title": "Settings: Preferences", "enable_hardware_acceleration": "Enable hardware acceleration", "enable_tray_icon": "Show tray icon and minimise window to it on close", "keyboard_heading": "Keyboard shortcuts", @@ -2687,6 +2697,7 @@ "dehydrated_device_enabled": "Offline device enabled", "delete_backup": "Delete Backup", "delete_backup_confirm_description": "Are you sure? You will lose your encrypted messages if your keys are not backed up properly.", + "dialog_title": "Settings: Security & Privacy", "e2ee_default_disabled_warning": "Your server admin has disabled end-to-end encryption by default in private rooms & Direct Messages.", "enable_message_search": "Enable message search in encrypted rooms", "encryption_individual_verification_mode": "Individually verify each session used by a user to mark it as trusted, not trusting cross-signed devices.", @@ -2766,6 +2777,7 @@ "device_unverified_description_current": "Verify your current session for enhanced secure messaging.", "device_verified_description": "This session is ready for secure messaging.", "device_verified_description_current": "Your current session is ready for secure messaging.", + "dialog_title": "Settings: Sessions", "error_pusher_state": "Failed to set pusher state", "error_set_name": "Failed to set session name", "filter_all": "All", @@ -2849,6 +2861,7 @@ "show_typing_notifications": "Show typing notifications", "showbold": "Show all activity in the room list (dots or number of unread messages)", "sidebar": { + "dialog_title": "Settings: Sidebar", "metaspaces_favourites_description": "Group all your favourite rooms and people in one place.", "metaspaces_home_all_rooms": "Show all rooms", "metaspaces_home_all_rooms_description": "Show all your rooms in Home, even if they're in a space.", @@ -2878,6 +2891,7 @@ "audio_output_empty": "No Audio Outputs detected", "auto_gain_control": "Automatic gain control", "connection_section": "Connection", + "dialog_title": "Settings: Voice & Video", "echo_cancellation": "Echo cancellation", "enable_fallback_ice_server": "Allow fallback call assist server (%(server)s)", "enable_fallback_ice_server_description": "Only applies if your homeserver does not offer one. Your IP address would be shared during a call.", diff --git a/test/components/views/dialogs/UserSettingsDialog-test.tsx b/test/components/views/dialogs/UserSettingsDialog-test.tsx index 7524f1469fd..72232d5e1b5 100644 --- a/test/components/views/dialogs/UserSettingsDialog-test.tsx +++ b/test/components/views/dialogs/UserSettingsDialog-test.tsx @@ -15,7 +15,7 @@ limitations under the License. */ import React, { ReactElement } from "react"; -import { render } from "@testing-library/react"; +import { render, screen } from "@testing-library/react"; import { mocked, MockedObject } from "jest-mock"; import { MatrixClient } from "matrix-js-sdk/src/matrix"; @@ -29,6 +29,8 @@ import { mockClientMethodsServer, mockPlatformPeg, mockClientMethodsCrypto, + mockClientMethodsRooms, + useMockMediaDevices, } from "../../../test-utils"; import { UIFeature } from "../../../../src/settings/UIFeature"; import { SettingLevel } from "../../../../src/settings/SettingLevel"; @@ -48,6 +50,10 @@ jest.mock("../../../../src/settings/SettingsStore", () => ({ unwatchSetting: jest.fn(), getFeatureSettingNames: jest.fn(), getBetaInfo: jest.fn(), + getDisplayName: jest.fn(), + getDescription: jest.fn(), + shouldHaveWarning: jest.fn(), + disabledMessage: jest.fn(), })); jest.mock("../../../../src/SdkConfig", () => ({ @@ -72,31 +78,32 @@ describe("", () => { ...mockClientMethodsUser(userId), ...mockClientMethodsServer(), ...mockClientMethodsCrypto(), + ...mockClientMethodsRooms(), + getIgnoredUsers: jest.fn().mockResolvedValue([]), + getPushers: jest.fn().mockResolvedValue([]), + getProfileInfo: jest.fn().mockResolvedValue({}), }); sdkContext = new SdkContextClass(); sdkContext.client = mockClient; mockSettingsStore.getValue.mockReturnValue(false); + mockSettingsStore.getValueAt.mockReturnValue(false); mockSettingsStore.getFeatureSettingNames.mockReturnValue([]); mockSdkConfig.get.mockReturnValue({ brand: "Test" }); }); const getActiveTabLabel = (container: Element) => container.querySelector(".mx_TabbedView_tabLabel_active")?.textContent; - const getActiveTabHeading = (container: Element) => - container.querySelector(".mx_SettingsSection .mx_Heading_h3")?.textContent; it("should render general settings tab when no initialTabId", () => { const { container } = render(getComponent()); expect(getActiveTabLabel(container)).toEqual("General"); - expect(getActiveTabHeading(container)).toEqual("General"); }); it("should render initial tab when initialTabId is set", () => { const { container } = render(getComponent({ initialTabId: UserTab.Help })); expect(getActiveTabLabel(container)).toEqual("Help & About"); - expect(getActiveTabHeading(container)).toEqual("Help & About"); }); it("should render general tab if initialTabId tab cannot be rendered", () => { @@ -104,7 +111,6 @@ describe("", () => { const { container } = render(getComponent({ initialTabId: UserTab.Mjolnir })); expect(getActiveTabLabel(container)).toEqual("General"); - expect(getActiveTabHeading(container)).toEqual("General"); }); it("renders tabs correctly", () => { @@ -124,9 +130,95 @@ describe("", () => { expect(getByTestId(`settings-tab-${UserTab.Voice}`)).toBeTruthy(); }); - it("renders session manager tab", () => { - const { getByTestId } = render(getComponent()); + it("renders with session manager tab selected", () => { + const { getByTestId } = render(getComponent({ initialTabId: UserTab.SessionManager })); expect(getByTestId(`settings-tab-${UserTab.SessionManager}`)).toBeTruthy(); + expect(screen.getByRole("heading", { level: 1 })).toHaveTextContent("Settings: Sessions"); + }); + + it("renders with appearance tab selected", () => { + const { container } = render(getComponent({ initialTabId: UserTab.Appearance })); + + expect(getActiveTabLabel(container)).toEqual("Appearance"); + expect(screen.getByRole("heading", { level: 1 })).toHaveTextContent("Settings: Appearance"); + }); + + it("renders with notifications tab selected", () => { + const { container } = render(getComponent({ initialTabId: UserTab.Notifications })); + + expect(getActiveTabLabel(container)).toEqual("Notifications"); + expect(screen.getByRole("heading", { level: 1 })).toHaveTextContent("Settings: Notifications"); + }); + + it("renders with preferences tab selected", () => { + const { container } = render(getComponent({ initialTabId: UserTab.Preferences })); + + expect(getActiveTabLabel(container)).toEqual("Preferences"); + expect(screen.getByRole("heading", { level: 1 })).toHaveTextContent("Settings: Preferences"); + }); + + it("renders with keyboard tab selected", () => { + const { container } = render(getComponent({ initialTabId: UserTab.Keyboard })); + + expect(getActiveTabLabel(container)).toEqual("Keyboard"); + expect(screen.getByRole("heading", { level: 1 })).toHaveTextContent("Settings: Keyboard"); + }); + + it("renders with sidebar tab selected", () => { + const { container } = render(getComponent({ initialTabId: UserTab.Sidebar })); + + expect(getActiveTabLabel(container)).toEqual("Sidebar"); + expect(screen.getByRole("heading", { level: 1 })).toHaveTextContent("Settings: Sidebar"); + }); + + it("renders with voip tab selected", () => { + useMockMediaDevices(); + mockSettingsStore.getValue.mockImplementation((settingName): any => settingName === UIFeature.Voip); + const { container } = render(getComponent({ initialTabId: UserTab.Voice })); + + expect(getActiveTabLabel(container)).toEqual("Voice & Video"); + expect(screen.getByRole("heading", { level: 1 })).toHaveTextContent("Settings: Voice & Video"); + }); + + it("renders with secutity tab selected", () => { + const { container } = render(getComponent({ initialTabId: UserTab.Security })); + + expect(getActiveTabLabel(container)).toEqual("Security & Privacy"); + expect(screen.getByRole("heading", { level: 1 })).toHaveTextContent("Settings: Security & Privacy"); + }); + + it("renders with labs tab selected", () => { + // @ts-ignore I give up trying to get the types right here + // why do we have functions that return different things depending on what they're passed? + mockSdkConfig.get.mockImplementation((x) => { + const mockConfig = { show_labs_settings: true, brand: "Test" }; + switch (x) { + case "show_labs_settings": + case "brand": + // @ts-ignore + return mockConfig[x]; + default: + return mockConfig; + } + }); + const { container } = render(getComponent({ initialTabId: UserTab.Labs })); + + expect(getActiveTabLabel(container)).toEqual("Labs"); + expect(screen.getByRole("heading", { level: 1 })).toHaveTextContent("Settings: Labs"); + }); + + it("renders with mjolnir tab selected", () => { + mockSettingsStore.getValue.mockImplementation((settingName): any => settingName === "feature_mjolnir"); + const { container } = render(getComponent({ initialTabId: UserTab.Mjolnir })); + expect(getActiveTabLabel(container)).toEqual("Ignored users"); + expect(screen.getByRole("heading", { level: 1 })).toHaveTextContent("Ignored Users"); + }); + + it("renders with help tab selected", () => { + const { container } = render(getComponent({ initialTabId: UserTab.Help })); + + expect(getActiveTabLabel(container)).toEqual("Help & About"); + expect(screen.getByRole("heading", { level: 1 })).toHaveTextContent("Settings: Help & About"); }); it("renders labs tab when show_labs_settings is enabled in config", () => { diff --git a/test/components/views/settings/notifications/__snapshots__/Notifications2-test.tsx.snap b/test/components/views/settings/notifications/__snapshots__/Notifications2-test.tsx.snap index 84b9188a7c1..bb945a50245 100644 --- a/test/components/views/settings/notifications/__snapshots__/Notifications2-test.tsx.snap +++ b/test/components/views/settings/notifications/__snapshots__/Notifications2-test.tsx.snap @@ -8,11 +8,6 @@ exports[` correctly handles the loading/disabled state 1`] = `
-

- Notifications -

@@ -781,11 +776,6 @@ exports[` matches the snapshot 1`] = `
-

- Notifications -

diff --git a/test/components/views/settings/tabs/user/__snapshots__/AppearanceUserSettingsTab-test.tsx.snap b/test/components/views/settings/tabs/user/__snapshots__/AppearanceUserSettingsTab-test.tsx.snap index f4a0c9100ea..b2ab3a6e833 100644 --- a/test/components/views/settings/tabs/user/__snapshots__/AppearanceUserSettingsTab-test.tsx.snap +++ b/test/components/views/settings/tabs/user/__snapshots__/AppearanceUserSettingsTab-test.tsx.snap @@ -12,19 +12,9 @@ exports[`AppearanceUserSettingsTab should render 1`] = `
-

- Customise your appearance -

-
- Appearance Settings only affect this Element session. -
-

- Keyboard -

diff --git a/test/components/views/settings/tabs/user/__snapshots__/MjolnirUserSettingsTab-test.tsx.snap b/test/components/views/settings/tabs/user/__snapshots__/MjolnirUserSettingsTab-test.tsx.snap index e6e2519ab0f..4bdaf3275c8 100644 --- a/test/components/views/settings/tabs/user/__snapshots__/MjolnirUserSettingsTab-test.tsx.snap +++ b/test/components/views/settings/tabs/user/__snapshots__/MjolnirUserSettingsTab-test.tsx.snap @@ -11,11 +11,6 @@ exports[` renders correctly when user has no ignored u
-

- Ignored users -

diff --git a/test/components/views/settings/tabs/user/__snapshots__/PreferencesUserSettingsTab-test.tsx.snap b/test/components/views/settings/tabs/user/__snapshots__/PreferencesUserSettingsTab-test.tsx.snap index 45e1999af68..e9050a94da5 100644 --- a/test/components/views/settings/tabs/user/__snapshots__/PreferencesUserSettingsTab-test.tsx.snap +++ b/test/components/views/settings/tabs/user/__snapshots__/PreferencesUserSettingsTab-test.tsx.snap @@ -12,11 +12,6 @@ exports[`PreferencesUserSettingsTab should render 1`] = `
-

- Preferences -

diff --git a/test/components/views/settings/tabs/user/__snapshots__/SidebarUserSettingsTab-test.tsx.snap b/test/components/views/settings/tabs/user/__snapshots__/SidebarUserSettingsTab-test.tsx.snap index c5315e99bc6..f098d80e846 100644 --- a/test/components/views/settings/tabs/user/__snapshots__/SidebarUserSettingsTab-test.tsx.snap +++ b/test/components/views/settings/tabs/user/__snapshots__/SidebarUserSettingsTab-test.tsx.snap @@ -11,11 +11,6 @@ exports[` renders sidebar settings with guest spa url
-

- Sidebar -

@@ -257,11 +252,6 @@ exports[` renders sidebar settings without guest spa u
-

- Sidebar -

diff --git a/test/test-utils/client.ts b/test/test-utils/client.ts index 8a991b0e9cc..03dc475d32d 100644 --- a/test/test-utils/client.ts +++ b/test/test-utils/client.ts @@ -17,7 +17,7 @@ limitations under the License. import EventEmitter from "events"; import { MethodLikeKeys, mocked, MockedObject, PropertyLikeKeys } from "jest-mock"; import { Feature, ServerSupport } from "matrix-js-sdk/src/feature"; -import { MatrixClient, User } from "matrix-js-sdk/src/matrix"; +import { MatrixClient, Room, User } from "matrix-js-sdk/src/matrix"; import { MatrixClientPeg } from "../../src/MatrixClientPeg"; @@ -173,4 +173,9 @@ export const mockClientMethodsCrypto = (): Partial< getOwnDeviceKeys: jest.fn(), getCrossSigningKeyId: jest.fn(), }), + getDeviceEd25519Key: jest.fn(), +}); + +export const mockClientMethodsRooms = (rooms: Room[] = []): Partial, unknown>> => ({ + getRooms: jest.fn().mockReturnValue(rooms), });