Refactor footer component and integrate into landing page

- Remove unnecessary elements and simplify the footer layout
- Update copyright notice and styling for consistency
- Add Footer27 component to the landing page
- Enhance tests to verify footer rendering and legal links
This commit is contained in:
2026-05-06 22:06:43 +02:00
parent d2ba994fad
commit 3440508bac
6 changed files with 326 additions and 45 deletions

View File

@@ -7,12 +7,17 @@ const sourcePaths = [
new URL("../src/components/landing-hero-section.tsx", import.meta.url),
];
const footerPath = new URL("../src/components/footer27.tsx", import.meta.url);
const indexPath = new URL("../src/pages/index.astro", import.meta.url);
const impressumPath = new URL("../src/pages/impressum.astro", import.meta.url);
const datenschutzPath = new URL("../src/pages/datenschutz.astro", import.meta.url);
test("Landing component contains the core brief anchors", async () => {
const source = (
await Promise.all(sourcePaths.map((p) => readFile(p, "utf8")))
).join("\n");
for (const phrase of ["Projektbrief", "01", "Website", "Kontakt", "für", "müssen", "Änderungen"]) {
for (const phrase of ["Online Fertig Passt", "01", "Website", "Kontakt", "für", "müssen", "Änderungen"]) {
assert.match(source, new RegExp(phrase));
}
});
@@ -37,3 +42,44 @@ test("Landing component uses real German umlauts in visible copy", async () => {
assert.doesNotMatch(source, new RegExp(asciiFallback));
}
});
test("Landing page renders the footer with legal links", async () => {
const [indexSource, footerSource] = await Promise.all([
readFile(indexPath, "utf8"),
readFile(footerPath, "utf8"),
]);
assert.match(indexSource, /import\s+\{\s*Footer27\s*\}/);
assert.match(indexSource, /<Footer27\s*\/>/);
assert.match(footerSource, /href="\/impressum"/);
assert.match(footerSource, /href="\/datenschutz"/);
assert.match(footerSource, /© 2026 Matthias Meister Webdesign/);
assert.doesNotMatch(footerSource, /Bereit für eine Website/);
assert.doesNotMatch(footerSource, /Kostenloses Angebot anfordern/);
assert.doesNotMatch(footerSource, /max-w-6xl/);
});
test("Legal pages contain required business and privacy information", async () => {
const [impressumSource, datenschutzSource] = await Promise.all([
readFile(impressumPath, "utf8"),
readFile(datenschutzPath, "utf8"),
]);
for (const phrase of [
"Matthias Meister Softwareentwicklung",
"Karl-Marx-Str. 22",
"08451 Crimmitschau",
"DE460155697",
]) {
assert.match(impressumSource, new RegExp(phrase));
}
for (const phrase of [
"keine Cookies",
"mailto",
"Rybbit",
"rybbit.matthias.lol",
]) {
assert.match(datenschutzSource, new RegExp(phrase));
}
});