diff --git a/src/components/SettingsDialog/Appearance/__tests__/Appearance.test.tsx b/src/components/SettingsDialog/Appearance/__tests__/Appearance.test.tsx index 946f3037e4..30576bf63b 100644 --- a/src/components/SettingsDialog/Appearance/__tests__/Appearance.test.tsx +++ b/src/components/SettingsDialog/Appearance/__tests__/Appearance.test.tsx @@ -5,6 +5,8 @@ import getTestStore from "utils/test/getTestStore"; import {Appearance} from "../Appearance"; import {getByLabelText} from "@testing-library/dom"; import i18n from "i18nTest"; +import {within} from "@testing-library/react"; +import {t} from "i18next"; const createAppearance = () => ( @@ -13,9 +15,18 @@ const createAppearance = () => ( ); describe("Appearance", () => { - test("should render all Settings correctly", () => { + test("should render all Settings correctly with Snowfall", () => { + jest.useFakeTimers().setSystemTime(new Date(2025, 11, 24)); // Christmas! const {container} = render(createAppearance()); expect(container.firstChild).toMatchSnapshot(); + expect(within(container.getElementsByClassName("appearance-container")[0] as HTMLDivElement).queryByLabelText(t("Appearance.showSnowfall"))).toBeInTheDocument(); + }); + + test("should render all Settings correctly without Snowfall", () => { + jest.useFakeTimers().setSystemTime(new Date(2025, 5, 7)); // my birthday! + const {container} = render(createAppearance()); + expect(container.firstChild).toMatchSnapshot(); + expect(within(container.getElementsByClassName("appearance-container")[0] as HTMLDivElement).queryByLabelText(t("Appearance.showSnowfall"))).not.toBeInTheDocument(); }); test("should have a notifications toggle", () => { diff --git a/src/components/SettingsDialog/Appearance/__tests__/__snapshots__/Appearance.test.tsx.snap b/src/components/SettingsDialog/Appearance/__tests__/__snapshots__/Appearance.test.tsx.snap index 0549d64105..aa8206e0af 100644 --- a/src/components/SettingsDialog/Appearance/__tests__/__snapshots__/Appearance.test.tsx.snap +++ b/src/components/SettingsDialog/Appearance/__tests__/__snapshots__/Appearance.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Appearance should render all Settings correctly 1`] = ` +exports[`Appearance should render all Settings correctly with Snowfall 1`] = `
@@ -318,3 +318,304 @@ exports[`Appearance should render all Settings correctly 1`] = `
`; + +exports[`Appearance should render all Settings correctly without Snowfall 1`] = ` +
+
+

+ Appearance +

+
+
+
+ + Color scheme + +
+ + + +
+
+
+ +
+
+ +
+
+ + +
+
+ + +
+
+
+`;