// @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 source = readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), "portals.tsx"), "utf8"); describe("admin portals route links", () => { it("does not link system portals to a missing admin portal detail route", () => { expect(source).not.toContain("adminPath(`portals/${item.id}`"); expect(source).toContain(": item.portalUrl"); }); it("keeps the system tenant label localized", () => { expect(source).not.toContain('?? "{Admin}"'); expect(source).toContain('t("shared.admin")'); }); });