Improve site navigation structure
Deploy / deploy-master (push) Skipped
Deploy / deploy-dev (push) Successful in 12s
Deploy / app-quality (push) Successful in 1m8s
Deploy / secret-scan (push) Successful in 4s
Deploy / security-deps (push) Successful in 6s
Deploy / app-image (push) Successful in 1m1s
Deploy / validate-dispatch (push) Successful in 1s
Deploy / scheduled-rebuild-dev (push) Skipped
Deploy / scheduled-rebuild-master (push) Skipped
Deploy / rollback-dev (push) Skipped
Deploy / rollback-master (push) Skipped
Deploy / changes (push) Successful in 3s
Deploy / context (push) Successful in 1s
Deploy / deploy-master (push) Skipped
Deploy / deploy-dev (push) Successful in 12s
Deploy / app-quality (push) Successful in 1m8s
Deploy / secret-scan (push) Successful in 4s
Deploy / security-deps (push) Successful in 6s
Deploy / app-image (push) Successful in 1m1s
Deploy / validate-dispatch (push) Successful in 1s
Deploy / scheduled-rebuild-dev (push) Skipped
Deploy / scheduled-rebuild-master (push) Skipped
Deploy / rollback-dev (push) Skipped
Deploy / rollback-master (push) Skipped
Deploy / changes (push) Successful in 3s
Deploy / context (push) Successful in 1s
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import pages from "../../content/pages/pages.json";
|
||||
import { directNavigationItems, findNavigationGroup, navigationGroups } from "../lib/navigation";
|
||||
|
||||
describe("Navigationsstruktur", () => {
|
||||
it("ordnet jede statische Fachseite genau einem Bereich zu", () => {
|
||||
const roots = new Set(navigationGroups.map((group) => group.href));
|
||||
const expected = pages.map((page) => `/${page.slug}`).filter((href) => !roots.has(href)).sort();
|
||||
const actual = navigationGroups.flatMap((group) => group.children.map((item) => item.href)).sort();
|
||||
|
||||
expect(actual).toEqual(expected);
|
||||
expect(new Set(actual).size).toBe(actual.length);
|
||||
});
|
||||
|
||||
it("führt alle Navigationsziele auf existierende Seiten", () => {
|
||||
const pagePaths = new Set(pages.map((page) => `/${page.slug}`));
|
||||
const fixedRoutes = new Set(["/aktuelles", "/termine"]);
|
||||
const targets = [
|
||||
...directNavigationItems.map((item) => item.href),
|
||||
...navigationGroups.flatMap((group) => [group.href, ...group.children.map((item) => item.href)]),
|
||||
];
|
||||
|
||||
expect(targets.every((href) => pagePaths.has(href) || fixedRoutes.has(href))).toBe(true);
|
||||
});
|
||||
|
||||
it("ordnet Kontakt dem Servicebereich zu", () => {
|
||||
expect(findNavigationGroup("/kontakt")?.href).toBe("/service");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user