diff --git a/playwright/e2e/settings/notifications/notifications-settings-2-tab.spec.ts b/playwright/e2e/settings/notifications/notifications-settings-2-tab.spec.ts new file mode 100644 index 0000000000..ea8298134a --- /dev/null +++ b/playwright/e2e/settings/notifications/notifications-settings-2-tab.spec.ts @@ -0,0 +1,25 @@ +/* +Copyright 2025 New Vector Ltd. + +SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial +Please see LICENSE files in the repository root for full details. +*/ + +import { test, expect } from "../../../element-web-test"; +import { SettingLevel } from "../../../../src/settings/SettingLevel"; + +test.describe("Notifications 2 tab", () => { + test.use({ + displayName: "Alice", + }); + + test("should display notification settings", {tag: "@screenshot"}, async ({ page, app, user }) => { + await app.settings.setValue("feature_notification_settings2", null, SettingLevel.DEVICE, true); + await page.setViewportSize({ width: 1024, height: 2000 }); + const settings = await app.settings.openUserSettings("Notifications"); + await expect(settings).toMatchScreenshot("standard-notifications-2-settings.png", { + // Mask the mxid. + mask: [settings.locator("#mx_NotificationSettings2_MentionCheckbox span")] + }); + }); +}); diff --git a/playwright/e2e/settings/notifications/notifications-settings-tab.spec.ts b/playwright/e2e/settings/notifications/notifications-settings-tab.spec.ts new file mode 100644 index 0000000000..c0f3b66fc9 --- /dev/null +++ b/playwright/e2e/settings/notifications/notifications-settings-tab.spec.ts @@ -0,0 +1,22 @@ +/* +Copyright 2025 New Vector Ltd. + +SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial +Please see LICENSE files in the repository root for full details. +*/ + +import { test, expect } from "../../../element-web-test"; + +test.describe("Notifications tab", () => { + test.use({ + displayName: "Alice", + }); + + test("should display notification settings", {tag: "@screenshot"}, async ({ page, app, user }) => { + await page.setViewportSize({ width: 1024, height: 1400 }); + const settings = await app.settings.openUserSettings("Notifications"); + await settings.getByLabel("Enable notifications for this account").check(); + await settings.getByLabel("Enable notifications for this session").check(); + await expect(settings).toMatchScreenshot("standard-notification-settings.png"); + }); +}); diff --git a/playwright/snapshots/settings/notifications/notifications-settings-2-tab.spec.ts/standard-notifications-2-settings-linux.png b/playwright/snapshots/settings/notifications/notifications-settings-2-tab.spec.ts/standard-notifications-2-settings-linux.png new file mode 100644 index 0000000000..25ae551cbe Binary files /dev/null and b/playwright/snapshots/settings/notifications/notifications-settings-2-tab.spec.ts/standard-notifications-2-settings-linux.png differ diff --git a/playwright/snapshots/settings/notifications/notifications-settings-tab.spec.ts/standard-notification-settings-linux.png b/playwright/snapshots/settings/notifications/notifications-settings-tab.spec.ts/standard-notification-settings-linux.png new file mode 100644 index 0000000000..688b0561ec Binary files /dev/null and b/playwright/snapshots/settings/notifications/notifications-settings-tab.spec.ts/standard-notification-settings-linux.png differ diff --git a/src/components/views/elements/LabelledCheckbox.tsx b/src/components/views/elements/LabelledCheckbox.tsx index ba07ed9201..45cef43da9 100644 --- a/src/components/views/elements/LabelledCheckbox.tsx +++ b/src/components/views/elements/LabelledCheckbox.tsx @@ -24,11 +24,13 @@ interface IProps { onChange(checked: boolean): void; // Optional additional CSS class to apply to the label className?: string; + // The id for the checkbox + id?: string; } -const LabelledCheckbox: React.FC = ({ value, label, byline, disabled, onChange, className }) => { +const LabelledCheckbox: React.FC = ({ value, label, byline, disabled, onChange, className, id }) => { return ( -
+
{