From 7df3b45ee3e9debd58b6813eba5395c0fbb1edcd Mon Sep 17 00:00:00 2001 From: Half-Shot Date: Tue, 8 Jul 2025 17:03:56 +0100 Subject: [PATCH] Fixup unit tests to check correct attributes. --- .../views/dialogs/CreateRoomDialog-test.tsx | 19 +- .../ConfirmRejectInviteDialog-test.tsx.snap | 90 +- .../DevtoolsDialog-test.tsx.snap | 206 +- .../ReportRoomDialog-test.tsx.snap | 42 +- .../views/location/LocationShareMenu-test.tsx | 4 +- .../LocationShareMenu-test.tsx.snap | 67 +- .../RoomSummaryCardView-test.tsx.snap | 3 + .../room_settings/UrlPreviewSettings-test.tsx | 8 +- .../UrlPreviewSettings-test.tsx.snap | 396 +- .../views/settings/LayoutSwitcher-test.tsx | 6 +- .../views/settings/Notifications-test.tsx | 30 +- .../views/settings/ThemeChoicePanel-test.tsx | 8 +- .../LayoutSwitcher-test.tsx.snap | 1 + .../__snapshots__/Notifications-test.tsx.snap | 172 +- .../SetIntegrationManager-test.tsx.snap | 58 +- .../ThemeChoicePanel-test.tsx.snap | 3 + .../encryption/AdvancedPanel-test.tsx | 2 +- .../__snapshots__/AdvancedPanel-test.tsx.snap | 1 + .../notifications/Notifications2-test.tsx | 2 +- .../Notifications2-test.tsx.snap | 4271 +++++++++-------- .../room/SecurityRoomSettingsTab-test.tsx | 14 +- .../tabs/room/VoipRoomSettingsTab-test.tsx | 12 +- .../user/PreferencesUserSettingsTab-test.tsx | 13 +- .../AppearanceUserSettingsTab-test.tsx.snap | 45 +- .../PreferencesUserSettingsTab-test.tsx.snap | 2727 ++++++----- .../SecurityUserSettingsTab-test.tsx.snap | 149 +- .../SpaceSettingsVisibilityTab-test.tsx | 14 +- .../SpaceSettingsVisibilityTab-test.tsx.snap | 72 +- 28 files changed, 4447 insertions(+), 3988 deletions(-) diff --git a/test/unit-tests/components/views/dialogs/CreateRoomDialog-test.tsx b/test/unit-tests/components/views/dialogs/CreateRoomDialog-test.tsx index ad3dcd58e9..3e4749b314 100644 --- a/test/unit-tests/components/views/dialogs/CreateRoomDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/CreateRoomDialog-test.tsx @@ -26,9 +26,6 @@ describe("", () => { }); const getE2eeEnableToggleInputElement = () => screen.getByLabelText("Enable end-to-end encryption"); - // labelled toggle switch doesn't set the disabled attribute, only aria-disabled - const getE2eeEnableToggleIsDisabled = () => - getE2eeEnableToggleInputElement().getAttribute("aria-disabled") === "true"; beforeEach(() => { mockClient.doesServerForceEncryptionForPreset.mockResolvedValue(false); @@ -66,7 +63,7 @@ describe("", () => { await flushPromises(); expect(getE2eeEnableToggleInputElement()).not.toBeChecked(); - expect(getE2eeEnableToggleIsDisabled()).toBeFalsy(); + expect(getE2eeEnableToggleInputElement()).not.toBeDisabled(); expect( screen.getByText( "Your server admin has disabled end-to-end encryption by default in private rooms & Direct Messages.", @@ -86,7 +83,7 @@ describe("", () => { await flushPromises(); expect(getE2eeEnableToggleInputElement()).not.toBeChecked(); - expect(getE2eeEnableToggleIsDisabled()).toBeTruthy(); + expect(getE2eeEnableToggleInputElement()).toBeDisabled(); expect( screen.getByText( "Your server admin has disabled end-to-end encryption by default in private rooms & Direct Messages.", @@ -106,7 +103,7 @@ describe("", () => { await flushPromises(); // encryption enabled expect(getE2eeEnableToggleInputElement()).toBeChecked(); - expect(getE2eeEnableToggleIsDisabled()).toBeFalsy(); + expect(getE2eeEnableToggleInputElement()).not.toBeDisabled(); }); it("should use defaultEncrypted prop when it is false", async () => { @@ -122,7 +119,7 @@ describe("", () => { // encryption disabled expect(getE2eeEnableToggleInputElement()).not.toBeChecked(); // not forced to off - expect(getE2eeEnableToggleIsDisabled()).toBeFalsy(); + expect(getE2eeEnableToggleInputElement()).not.toBeDisabled(); }); it("should override defaultEncrypted when server .well-known forces disabled encryption", async () => { @@ -137,7 +134,7 @@ describe("", () => { // server forces encryption to disabled, even though defaultEncrypted is false expect(getE2eeEnableToggleInputElement()).not.toBeChecked(); - expect(getE2eeEnableToggleIsDisabled()).toBeTruthy(); + expect(getE2eeEnableToggleInputElement()).toBeDisabled(); expect( screen.getByText( "Your server admin has disabled end-to-end encryption by default in private rooms & Direct Messages.", @@ -152,7 +149,7 @@ describe("", () => { // server forces encryption to enabled, even though defaultEncrypted is true expect(getE2eeEnableToggleInputElement()).toBeChecked(); - expect(getE2eeEnableToggleIsDisabled()).toBeTruthy(); + expect(getE2eeEnableToggleInputElement()).toBeDisabled(); expect(screen.getByText("Your server requires encryption to be enabled in private rooms.")).toBeDefined(); }); @@ -162,7 +159,7 @@ describe("", () => { await flushPromises(); expect(getE2eeEnableToggleInputElement()).toBeChecked(); - expect(getE2eeEnableToggleIsDisabled()).toBeTruthy(); + expect(getE2eeEnableToggleInputElement()).toBeDisabled(); expect(screen.getByText("Your server requires encryption to be enabled in private rooms.")).toBeDefined(); }); @@ -255,7 +252,7 @@ describe("", () => { it("should create a knock room with public visibility", async () => { fireEvent.click( - screen.getByRole("checkbox", { name: "Make this room visible in the public room directory." }), + screen.getByRole("switch", { name: "Make this room visible in the public room directory." }), ); fireEvent.click(screen.getByText("Create room")); await flushPromises(); diff --git a/test/unit-tests/components/views/dialogs/__snapshots__/ConfirmRejectInviteDialog-test.tsx.snap b/test/unit-tests/components/views/dialogs/__snapshots__/ConfirmRejectInviteDialog-test.tsx.snap index c2ca9a5680..64dd8208f6 100644 --- a/test/unit-tests/components/views/dialogs/__snapshots__/ConfirmRejectInviteDialog-test.tsx.snap +++ b/test/unit-tests/components/views/dialogs/__snapshots__/ConfirmRejectInviteDialog-test.tsx.snap @@ -31,67 +31,77 @@ exports[`ConfirmRejectInviteDialog can reject with options selected 1`] = ` Are you sure you want to decline the invitation to join "foo"?

-
+ +
+
+
+
+
+ You will not see any messages or room invites from this user. -
-
-
-
+ +
+
+
+
+
+ Report this room to your account provider. -
-
-
-
+

Options

- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
-
+
- -
+
+ +
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+ +
+
+
+ +
+ +
+
+
Report this room to your account provider. If the messages are encrypted, your admin will not be able to read them. @@ -65,28 +65,34 @@ exports[`ReportRoomDialog displays admin message 1`] = `

-
+ +
+
+
+
+
-
-
-
+
", () => { setShareType(getByText, LocationShareType.Live); - expect(getByText("OK").hasAttribute("disabled")).toBeTruthy(); + expect(getByText("OK")).toHaveAttribute("aria-disabled", "true"); }); it("enables OK button when labs flag is toggled to enabled", () => { @@ -310,7 +310,7 @@ describe("", () => { fireEvent.click(getByLabelText("Enable live location sharing")); - expect(getByText("OK").hasAttribute("disabled")).toBeFalsy(); + expect(getByText("OK")).not.toHaveAttribute("aria-disabled", "true"); }); it("enables live share setting on ok button submit", () => { diff --git a/test/unit-tests/components/views/location/__snapshots__/LocationShareMenu-test.tsx.snap b/test/unit-tests/components/views/location/__snapshots__/LocationShareMenu-test.tsx.snap index 3ab56061be..5a7bc0a18d 100644 --- a/test/unit-tests/components/views/location/__snapshots__/LocationShareMenu-test.tsx.snap +++ b/test/unit-tests/components/views/location/__snapshots__/LocationShareMenu-test.tsx.snap @@ -18,41 +18,50 @@ exports[` with live location disabled goes to labs flag scr > Please note: this is a labs feature using a temporary implementation. This means you will not be able to delete your location history, and advanced users will be able to see your location history even after you stop sharing your live location with this room.

-
-
- Enable live location sharing +
+ +
+
- -
+ +
+
+
- + OK + +
`; diff --git a/test/unit-tests/components/views/right_panel/__snapshots__/RoomSummaryCardView-test.tsx.snap b/test/unit-tests/components/views/right_panel/__snapshots__/RoomSummaryCardView-test.tsx.snap index be6fdd5fcf..fea2a68e38 100644 --- a/test/unit-tests/components/views/right_panel/__snapshots__/RoomSummaryCardView-test.tsx.snap +++ b/test/unit-tests/components/views/right_panel/__snapshots__/RoomSummaryCardView-test.tsx.snap @@ -213,6 +213,7 @@ exports[` has button to edit topic 1`] = ` aria-hidden="true" class="_input_19o42_24" id="«rv»" + role="switch" type="checkbox" />
renders the room summary 1`] = ` aria-hidden="true" class="_input_19o42_24" id="«r5»" + role="switch" type="checkbox" />
renders the room topic in the summary 1`] = ` aria-hidden="true" class="_input_19o42_24" id="«ri»" + role="switch" type="checkbox" />
{ }); function renderComponent() { - return render(, withClientContextRenderOptions(client)); + return render( + + + , + withClientContextRenderOptions(client), + ); } it("should display the correct preview when the setting is in a loading state", () => { diff --git a/test/unit-tests/components/views/room_settings/__snapshots__/UrlPreviewSettings-test.tsx.snap b/test/unit-tests/components/views/room_settings/__snapshots__/UrlPreviewSettings-test.tsx.snap index 017f4bc2bb..3afe325a98 100644 --- a/test/unit-tests/components/views/room_settings/__snapshots__/UrlPreviewSettings-test.tsx.snap +++ b/test/unit-tests/components/views/room_settings/__snapshots__/UrlPreviewSettings-test.tsx.snap @@ -2,235 +2,269 @@ exports[`UrlPreviewSettings should display the correct preview when the room is encrypted and the url preview is enabled 1`] = ` -
- - URL Previews - -
-
-

- When someone puts a URL in their message, a URL preview can be shown to give more information about that link such as the title, description, and an image from the website. -

-

- In encrypted rooms, like this one, URL previews are disabled by default to ensure that your homeserver (where the previews are generated) cannot gather information about links you see in this room. -

-
-
-
+ URL Previews +
-
-
+

+ When someone puts a URL in their message, a URL preview can be shown to give more information about that link such as the title, description, and an image from the website. +

+

+ In encrypted rooms, like this one, URL previews are disabled by default to ensure that your homeserver (where the previews are generated) cannot gather information about links you see in this room. +

-
-
+
+
+
+
+ +
+
+
+
+ +
+
+
+ + `; exports[`UrlPreviewSettings should display the correct preview when the room is unencrypted and the url preview is disabled 1`] = ` -
- - URL Previews - -
-
+ URL Previews + +
-

- When someone puts a URL in their message, a URL preview can be shown to give more information about that link such as the title, description, and an image from the website. -

-

- - You have - -

- URL previews by default. -

-

-
-
-
- URL previews are disabled by default for participants in this room. -
-
-
+
+
+
+ URL previews are disabled by default for participants in this room. +
+ class="_inline-field-control_19upo_44" + > +
+ +
+
+
+
+ +
-
-
+ +
`; exports[`UrlPreviewSettings should display the correct preview when the room is unencrypted and the url preview is enabled 1`] = ` -
- - URL Previews - -
-
+ URL Previews + +
-

- When someone puts a URL in their message, a URL preview can be shown to give more information about that link such as the title, description, and an image from the website. -

-

- - You have - -

- URL previews by default. -

-

-
-
-
- URL previews are enabled by default for participants in this room. -
-
-
+
+
+
+ URL previews are enabled by default for participants in this room. +
+ class="_inline-field-control_19upo_44" + > +
+ +
+
+
+
+ +
-
-
+ +
`; exports[`UrlPreviewSettings should display the correct preview when the setting is in a loading state 1`] = ` -
- - URL Previews - -
- - - -
-
+ URL Previews + +
+ + + +
+ +
`; diff --git a/test/unit-tests/components/views/settings/LayoutSwitcher-test.tsx b/test/unit-tests/components/views/settings/LayoutSwitcher-test.tsx index 5d3f1709e2..5ff5f888c7 100644 --- a/test/unit-tests/components/views/settings/LayoutSwitcher-test.tsx +++ b/test/unit-tests/components/views/settings/LayoutSwitcher-test.tsx @@ -70,12 +70,12 @@ describe("", () => { await SettingsStore.setValue("useCompactLayout", null, SettingLevel.DEVICE, true); await renderLayoutSwitcher(); - expect(screen.getByRole("checkbox", { name: "Show compact text and messages" })).toBeChecked(); + expect(screen.getByRole("switch", { name: "Show compact text and messages" })).toBeChecked(); }); it("should change the setting when toggled", async () => { await renderLayoutSwitcher(); - act(() => screen.getByRole("checkbox", { name: "Show compact text and messages" }).click()); + act(() => screen.getByRole("switch", { name: "Show compact text and messages" }).click()); await waitFor(() => expect(SettingsStore.getValue("useCompactLayout")).toBe(true)); }); @@ -83,7 +83,7 @@ describe("", () => { it("should be disabled when the modern layout is not enabled", async () => { await SettingsStore.setValue("layout", null, SettingLevel.DEVICE, Layout.Bubble); await renderLayoutSwitcher(); - expect(screen.getByRole("checkbox", { name: "Show compact text and messages" })).toBeDisabled(); + expect(screen.getByRole("switch", { name: "Show compact text and messages" })).toBeDisabled(); }); }); }); diff --git a/test/unit-tests/components/views/settings/Notifications-test.tsx b/test/unit-tests/components/views/settings/Notifications-test.tsx index 6341a105fd..25a4ba880d 100644 --- a/test/unit-tests/components/views/settings/Notifications-test.tsx +++ b/test/unit-tests/components/views/settings/Notifications-test.tsx @@ -348,10 +348,10 @@ describe("", () => { await getComponentAndWait(); expect(screen.getByLabelText("Enable notifications for this account")).toBeInTheDocument(); - expect(screen.getByTestId("notif-device-switch")).toBeInTheDocument(); - expect(screen.getByTestId("notif-setting-notificationsEnabled")).toBeInTheDocument(); - expect(screen.getByTestId("notif-setting-notificationBodyEnabled")).toBeInTheDocument(); - expect(screen.getByTestId("notif-setting-audioNotificationsEnabled")).toBeInTheDocument(); + expect(screen.getByLabelText("Enable notifications for this device")).toBeInTheDocument(); + expect(screen.getByLabelText("Enable desktop notifications for this session")).toBeInTheDocument(); + expect(screen.getByLabelText("Show message preview in desktop notification")).toBeInTheDocument(); + expect(screen.getByLabelText("Enable audible notifications for this session")).toBeInTheDocument(); }); describe("email switches", () => { @@ -370,7 +370,7 @@ describe("", () => { it("renders email switches correctly when email 3pids exist", async () => { await getComponentAndWait(); - expect(screen.getByTestId("notif-email-switch")).toBeInTheDocument(); + expect(screen.getByLabelText(`Enable email notifications for ${testEmail}`)).toBeInTheDocument(); }); it("renders email switches correctly when notifications are on for email", async () => { @@ -379,14 +379,14 @@ describe("", () => { }); await getComponentAndWait(); - const emailSwitch = screen.getByTestId("notif-email-switch"); - expect(emailSwitch.querySelector('[aria-checked="true"]')).toBeInTheDocument(); + const emailSwitch = screen.getByLabelText(`Enable email notifications for ${testEmail}`); + expect(emailSwitch).toBeChecked(); }); it("enables email notification when toggling on", async () => { await getComponentAndWait(); - const emailToggle = screen.getByTestId("notif-email-switch").querySelector('div[role="switch"]')!; + const emailToggle = screen.getByLabelText(`Enable email notifications for ${testEmail}`); fireEvent.click(emailToggle); expect(mockClient.setPusher).toHaveBeenCalledWith( @@ -405,7 +405,7 @@ describe("", () => { mockClient.setPusher.mockRejectedValue({}); await getComponentAndWait(); - const emailToggle = screen.getByTestId("notif-email-switch").querySelector('div[role="switch"]')!; + const emailToggle = screen.getByLabelText(`Enable email notifications for ${testEmail}`); fireEvent.click(emailToggle); // force render @@ -431,7 +431,7 @@ describe("", () => { mockClient.getPushers.mockResolvedValue({ pushers: [testPusher] }); await getComponentAndWait(); - const emailToggle = screen.getByTestId("notif-email-switch").querySelector('div[role="switch"]')!; + const emailToggle = screen.getByLabelText(`Enable email notifications for ${testEmail}`); fireEvent.click(emailToggle); expect(mockClient.removePusher).toHaveBeenCalledWith(testPusher.pushkey, testPusher.app_id); @@ -452,22 +452,20 @@ describe("", () => { it("toggles and sets settings correctly", async () => { await getComponentAndWait(); - let audioNotifsToggle!: HTMLDivElement; + let audioNotifsToggle!: HTMLInputElement; const update = () => { - audioNotifsToggle = screen - .getByTestId("notif-setting-audioNotificationsEnabled") - .querySelector('div[role="switch"]')!; + audioNotifsToggle = screen.getByLabelText("Enable audible notifications for this session"); }; update(); - expect(audioNotifsToggle.getAttribute("aria-checked")).toEqual("true"); + expect(audioNotifsToggle).toBeChecked(); expect(SettingsStore.getValue("audioNotificationsEnabled")).toEqual(true); fireEvent.click(audioNotifsToggle); update(); - expect(audioNotifsToggle.getAttribute("aria-checked")).toEqual("false"); + expect(audioNotifsToggle).not.toBeChecked(); expect(SettingsStore.getValue("audioNotificationsEnabled")).toEqual(false); }); }); diff --git a/test/unit-tests/components/views/settings/ThemeChoicePanel-test.tsx b/test/unit-tests/components/views/settings/ThemeChoicePanel-test.tsx index f1dbc9a2e0..5332845d1b 100644 --- a/test/unit-tests/components/views/settings/ThemeChoicePanel-test.tsx +++ b/test/unit-tests/components/views/settings/ThemeChoicePanel-test.tsx @@ -56,24 +56,24 @@ describe("", () => { describe("system theme", () => { it("should disable Match system theme", async () => { render(); - expect(screen.getByRole("checkbox", { name: "Match system theme" })).not.toBeChecked(); + expect(screen.getByRole("switch", { name: "Match system theme" })).not.toBeChecked(); }); it("should enable Match system theme", async () => { await enableSystemTheme(true); render(); - expect(screen.getByRole("checkbox", { name: "Match system theme" })).toBeChecked(); + expect(screen.getByRole("switch", { name: "Match system theme" })).toBeChecked(); }); it("should change the system theme when clicked", async () => { jest.spyOn(SettingsStore, "setValue"); render(); - act(() => screen.getByRole("checkbox", { name: "Match system theme" }).click()); + act(() => screen.getByRole("switch", { name: "Match system theme" }).click()); // The system theme should be enabled - expect(screen.getByRole("checkbox", { name: "Match system theme" })).toBeChecked(); + expect(screen.getByRole("switch", { name: "Match system theme" })).toBeChecked(); expect(SettingsStore.setValue).toHaveBeenCalledWith("use_system_theme", null, "device", true); }); }); diff --git a/test/unit-tests/components/views/settings/__snapshots__/LayoutSwitcher-test.tsx.snap b/test/unit-tests/components/views/settings/__snapshots__/LayoutSwitcher-test.tsx.snap index 6c99c3fbeb..714703c0d0 100644 --- a/test/unit-tests/components/views/settings/__snapshots__/LayoutSwitcher-test.tsx.snap +++ b/test/unit-tests/components/views/settings/__snapshots__/LayoutSwitcher-test.tsx.snap @@ -418,6 +418,7 @@ exports[` should render 1`] = ` class="_input_19o42_24" id="radix-«rr»" name="compactLayout" + role="switch" title="" type="checkbox" /> diff --git a/test/unit-tests/components/views/settings/__snapshots__/Notifications-test.tsx.snap b/test/unit-tests/components/views/settings/__snapshots__/Notifications-test.tsx.snap index ae8a4aa46e..67091f7f02 100644 --- a/test/unit-tests/components/views/settings/__snapshots__/Notifications-test.tsx.snap +++ b/test/unit-tests/components/views/settings/__snapshots__/Notifications-test.tsx.snap @@ -2,94 +2,114 @@ exports[` main notification switches renders only enable notifications switch when notifications are disabled 1`] = `
-
- -
- Enable notifications for this account -
- - Turn off to disable notifications on all your devices and sessions - -
-
-
-
-
- -
+ class="_container_19o42_10" + > + +
+
+
+
+ + + Turn off to disable notifications on all your devices and sessions +
-
-
+ class="_inline-field-control_19upo_44" + > +
+ +
+
+
+
+ +
-
-
+
+
+
+ +
+
+
+
+ +
+
+ +
`; diff --git a/test/unit-tests/components/views/settings/__snapshots__/SetIntegrationManager-test.tsx.snap b/test/unit-tests/components/views/settings/__snapshots__/SetIntegrationManager-test.tsx.snap index 025afc3c97..cbf023e5c5 100644 --- a/test/unit-tests/components/views/settings/__snapshots__/SetIntegrationManager-test.tsx.snap +++ b/test/unit-tests/components/views/settings/__snapshots__/SetIntegrationManager-test.tsx.snap @@ -1,8 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`SetIntegrationManager should render manage integrations sections 1`] = ` -

(scalar.vector.im)

@@ -25,6 +26,7 @@ exports[`SetIntegrationManager should render manage integrations sections 1`] =
Use an integration manager @@ -39,40 +41,36 @@ exports[`SetIntegrationManager should render manage integrations sections 1`] = > Integration managers receive configuration data, and can modify widgets, send room invites, and set power levels on your behalf.
-
+
- -
-
-
-
- + class="_ui_19o42_34" + />
- -
+
+ +
+
+ `; diff --git a/test/unit-tests/components/views/settings/__snapshots__/ThemeChoicePanel-test.tsx.snap b/test/unit-tests/components/views/settings/__snapshots__/ThemeChoicePanel-test.tsx.snap index 487a674274..01f5b8b097 100644 --- a/test/unit-tests/components/views/settings/__snapshots__/ThemeChoicePanel-test.tsx.snap +++ b/test/unit-tests/components/views/settings/__snapshots__/ThemeChoicePanel-test.tsx.snap @@ -34,6 +34,7 @@ exports[` custom theme should display custom theme 1`] = ` class="_input_19o42_24" id="radix-«r28»" name="systemTheme" + role="switch" title="" type="checkbox" /> @@ -312,6 +313,7 @@ exports[` custom theme should render the custom theme sectio class="_input_19o42_24" id="radix-«r10»" name="systemTheme" + role="switch" title="" type="checkbox" /> @@ -590,6 +592,7 @@ exports[` renders the theme choice UI 1`] = ` class="_input_19o42_24" id="radix-«r0»" name="systemTheme" + role="switch" title="" type="checkbox" /> diff --git a/test/unit-tests/components/views/settings/encryption/AdvancedPanel-test.tsx b/test/unit-tests/components/views/settings/encryption/AdvancedPanel-test.tsx index ad98fa4e43..1876b607bb 100644 --- a/test/unit-tests/components/views/settings/encryption/AdvancedPanel-test.tsx +++ b/test/unit-tests/components/views/settings/encryption/AdvancedPanel-test.tsx @@ -74,7 +74,7 @@ describe("", () => { await renderAdvancedPanel(); expect(screen.getByTestId("otherSettings")).toMatchSnapshot(); - const checkbox = screen.getByRole("checkbox", { + const checkbox = screen.getByRole("switch", { name: "In encrypted rooms, only send messages to verified users", }); expect(checkbox).toBeChecked(); diff --git a/test/unit-tests/components/views/settings/encryption/__snapshots__/AdvancedPanel-test.tsx.snap b/test/unit-tests/components/views/settings/encryption/__snapshots__/AdvancedPanel-test.tsx.snap index 6fc4a56841..886f93fc94 100644 --- a/test/unit-tests/components/views/settings/encryption/__snapshots__/AdvancedPanel-test.tsx.snap +++ b/test/unit-tests/components/views/settings/encryption/__snapshots__/AdvancedPanel-test.tsx.snap @@ -224,6 +224,7 @@ exports[` should display the blacklist of unv class="_input_19o42_24" id="radix-«r6»" name="neverSendEncrypted" + role="switch" title="" type="checkbox" /> diff --git a/test/unit-tests/components/views/settings/notifications/Notifications2-test.tsx b/test/unit-tests/components/views/settings/notifications/Notifications2-test.tsx index d33b5c4e26..92cc5c70e0 100644 --- a/test/unit-tests/components/views/settings/notifications/Notifications2-test.tsx +++ b/test/unit-tests/components/views/settings/notifications/Notifications2-test.tsx @@ -114,7 +114,7 @@ describe("", () => { expect(screen.container).toMatchSnapshot(); const globalMute = screen.getByLabelText(labelGlobalMute); - expect(globalMute).toHaveAttribute("aria-disabled", "true"); + expect(globalMute).toBeDisabled(); const levelAllMessages = screen.getByLabelText(labelLevelAllMessage); expect(levelAllMessages).toBeDisabled(); diff --git a/test/unit-tests/components/views/settings/notifications/__snapshots__/Notifications2-test.tsx.snap b/test/unit-tests/components/views/settings/notifications/__snapshots__/Notifications2-test.tsx.snap index 6ec9599fe1..a95dfb6a65 100644 --- a/test/unit-tests/components/views/settings/notifications/__snapshots__/Notifications2-test.tsx.snap +++ b/test/unit-tests/components/views/settings/notifications/__snapshots__/Notifications2-test.tsx.snap @@ -11,2116 +11,256 @@ exports[` correctly handles the loading/disabled state 1`] = `
-
- -
- Enable notifications for this account -
-
-
-
-
-
-
- -
- Enable desktop notifications for this session -
-
-
-
-
-
-
- -
- Show message preview in desktop notification -
-
-
-
-
-
-
- -
- Enable audible notifications for this session -
-
-
-
-
-
-
-
-
-

- I want to be notified for (Default Setting) -

-
-
- This setting will be applied by default to all your rooms. -
-
-
-