feat(vorlagen): Editor, Liste und Versionsgeschichte (#24)
This commit was merged in pull request #24.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { navigationFuer } from "@/lib/navigation";
|
||||
import { existsSync } from "node:fs";
|
||||
import { NAVIGATION, navigationFuer } from "@/lib/navigation";
|
||||
import { darf } from "@/server/auth/rollen";
|
||||
import type { Rolle } from "@/generated/prisma/enums";
|
||||
|
||||
@@ -55,6 +56,19 @@ describe("Aufbau der Eintraege", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("hat zu jedem verfuegbaren Eintrag auch eine Seite", () => {
|
||||
// Das Umstellen von `verfuegbar` ist ein Handgriff im Meilenstein, der die
|
||||
// Seite liefert. Wird es zu frueh gemacht, zeigt die Navigation auf eine
|
||||
// 404 – und genau das faellt beim Klicken selten auf, weil man die eigene
|
||||
// neue Seite kennt und die anderen nicht anfasst.
|
||||
for (const eintrag of NAVIGATION) {
|
||||
if (!eintrag.verfuegbar) continue;
|
||||
const teil = eintrag.pfad === "/" ? "" : eintrag.pfad;
|
||||
const seite = new URL(`../src/app/(app)${teil}/page.tsx`, import.meta.url);
|
||||
expect(existsSync(seite), `${eintrag.pfad} ist verfuegbar, hat aber keine page.tsx`).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
it("hat keine doppelten Pfade je Modus", () => {
|
||||
for (const modus of ["INTERN", "DIENSTLEISTUNG"] as const) {
|
||||
const pfade = pfadeFuer(modus, "ADMIN");
|
||||
|
||||
Reference in New Issue
Block a user