diff --git a/src/routes.tsx b/src/routes.tsx
index 38ec62e..ba1c8bd 100644
--- a/src/routes.tsx
+++ b/src/routes.tsx
@@ -1,4 +1,5 @@
-import { Routes, Route } from "react-router-dom";
+import { Routes, Route, Outlet } from "react-router-dom";
+import Footer from "@/components/Footer";
import Index from "./pages/Index";
import ContactPage from "./pages/Contact";
import AGBPage from "./pages/AGB";
@@ -9,18 +10,29 @@ import HostingAboPage from "./pages/HostingAbo";
import DatenschutzPage from "./pages/Datenschutz";
import NotFound from "./pages/NotFound";
+/** Gemeinsamer Rahmen aller Unterseiten: Seiteninhalt, darunter der Footer mit Impressum, Datenschutz und Kündigen. */
+const SubpageLayout = () => (
+ <>
+
+
+ >
+);
+
/** Alle Seiten der Website; App.tsx rendert sie im BrowserRouter, die Tests im MemoryRouter. */
export const AppRoutes = () => (
+ {/* Die Startseite bringt ihren Footer selbst mit; /datenschutz leitet nur weiter. */}
} />
- } />
- } />
- } />
- } />
- } />
- } />
} />
- {/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
- } />
+ }>
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ {/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
+ } />
+
);
diff --git a/src/test/sofort-paket.test.tsx b/src/test/sofort-paket.test.tsx
index 0797518..652f2d7 100644
--- a/src/test/sofort-paket.test.tsx
+++ b/src/test/sofort-paket.test.tsx
@@ -259,3 +259,26 @@ describe("B5 Erfolgsversprechen entschärft", () => {
expect(screen.queryByText("Langfristige Partnerschaft")).toBeNull();
});
});
+
+describe("C1 Footer auf allen Unterseiten", () => {
+ const unterseiten = ["/kontakt", "/ueber-uns", "/agb", "/impressum", "/wartungs-abo", "/hosting-abo", "/gibt-es-nicht"];
+
+ it.each(unterseiten)("%s zeigt genau einen Footer mit Impressum und Datenschutz", (pfad) => {
+ seite(pfad);
+ const footer = screen.getByRole("contentinfo");
+ expect(within(footer).getByRole("link", { name: "Impressum" })).toHaveAttribute("href", "/impressum");
+ expect(within(footer).getByRole("link", { name: "Datenschutz" })).toHaveAttribute("href", DATENSCHUTZ);
+ });
+
+ it("die Startseite hat weiterhin genau einen Footer", () => {
+ seite("/");
+ expect(screen.getAllByRole("contentinfo")).toHaveLength(1);
+ });
+
+ it("der Footer steht hinter dem Seiteninhalt", () => {
+ seite("/impressum");
+ const inhalt = screen.getByRole("main");
+ const footer = screen.getByRole("contentinfo");
+ expect(inhalt.compareDocumentPosition(footer) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
+ });
+});