34 lines
1.5 KiB
TypeScript
34 lines
1.5 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 helpDeskShell = readAppFile("routes/admin/help-desk.tsx");
|
|
|
|
expect(helpDeskShell).not.toContain("help-desk/settings");
|
|
});
|
|
});
|