Files
HiveGrid-Wireframes/03 Quellen und Referenzen/hivegrid-cloud/apps/web/app/routes/disabled-plugin-links.test.ts
T

34 lines
1.4 KiB
TypeScript

// @vitest-environment node
import { readFileSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { describe, expect, it } from "vitest";
const appDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
const readAppFile = (relativePath: string) => readFileSync(path.join(appDir, relativePath), "utf8");
describe("disabled plugin route links", () => {
it("does not expose tenant links to disabled plugin route trees from core navigation", () => {
const settingsRoute = readAppFile("routes/app.$tenant/settings.tsx");
const commandRegistry = readAppFile("services/command-registry/commandRegistry.ts");
expect(settingsRoute).not.toContain('"settings/forms"');
expect(commandRegistry).not.toContain('tenantPath("portals"');
expect(commandRegistry).not.toContain('tenantPath("portals/new"');
expect(commandRegistry).not.toContain('tenantPath("crm"');
expect(commandRegistry).not.toContain('tenantPath("email-marketing"');
});
it("does not link feedback notifications to the disabled admin help desk route", () => {
const feedbackService = readAppFile("modules/helpDesk/services/Feedback.server.ts");
expect(feedbackService).not.toContain("help-desk/feedback");
});
it("does not keep disabled plugin links to missing route targets", () => {
const supportShell = readAppFile("routes/admin/support.tsx");
expect(supportShell).not.toContain("help-desk");
});
});