- {/* Hintergrundbild: auf Handy maximale Breite */}
+ {/* Hintergrundbild: auf Handy maximale Breite; nur im Dark Mode (dunkles Bild wäre im hellen ein graues Quadrat) */}
{
expect(lies("src/index.css")).toMatch(/section\[id\]\s*\{[^}]*scroll-margin-top:\s*6rem/);
});
});
+
+describe("A2 Hintergrundbilder nur im dunklen Modus", () => {
+ const BILDER: { name: string; ui: React.ReactElement; datei: string }[] = [
+ { name: "ProblemSection", ui:
, datei: "problem_blitz.jpg" },
+ { name: "SolutionSection", ui:
, datei: "loesung.jpg" },
+ { name: "Values", ui:
, datei: "backgroud_effect.webp" },
+ ];
+
+ it.each(BILDER)("$name: $datei ist im hellen Modus ausgeblendet und im dunklen sichtbar", ({ ui, datei }) => {
+ const { container } = zeige(ui);
+ const bild = container.querySelector
(`[style*="${datei}"]`);
+ expect(bild).not.toBeNull();
+ expect(bild).toHaveClass("hidden", "dark:block");
+ });
+});