import { readFileSync } from "node:fs"; import { resolve } from "node:path"; import { describe, expect, it } from "vitest"; function readComponent(name: string): string { return readFileSync(resolve(process.cwd(), `apps/web/app/components/screens/files/${name}`), "utf8"); } describe("file entity type i18n fallbacks", () => { it("never exposes an unknown persisted entity type as UI copy", () => { for (const name of ["FilesBrowserPage.tsx", "FileDetailPage.tsx"]) { const source = readComponent(name); expect(source).toContain('defaultValue: t("files.entityType.unknown")'); expect(source).not.toMatch(/defaultValue:\s*(?:type|link\.entityType)/); } }); });