import { readFileSync } from "node:fs"; import { join } from "node:path"; import { describe, expect, it } from "vitest"; const repoRoot = process.cwd(); describe("row share public route boundary", () => { it("does not accept public share targets after public row routes were removed", () => { const routeSource = readFileSync(join(repoRoot, "apps/web/app/modules/rows/routes/Rows_Share.server.ts"), "utf8"); const generatedShareSource = readFileSync(join(repoRoot, "apps/web/app/modules/codeGenerator/templates/routes/api/CodeTemplate.Routes.Share.Api.ts"), "utf8"); expect(routeSource).toContain('const allowedShareTypes = ["tenant", "user", "role", "group"] as const'); expect(routeSource).not.toContain('"tenant" | "user" | "role" | "group" | "public"'); expect(generatedShareSource).toContain('const allowedShareTypes = ["tenant", "user", "role", "group"] as const'); expect(generatedShareSource).not.toContain('"tenant" | "user" | "role" | "group" | "public"'); }); });