25 lines
1.0 KiB
TypeScript
25 lines
1.0 KiB
TypeScript
import fs from "node:fs";
|
|
import path from "node:path";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
const routeRoot = path.resolve(process.cwd(), "apps/web/app/routes/admin/entities");
|
|
|
|
function readRoute(relativePath: string) {
|
|
return fs.readFileSync(path.join(routeRoot, relativePath), "utf8");
|
|
}
|
|
|
|
describe("admin entity property previews i18n", () => {
|
|
it("uses semantic translation keys for preview labels", () => {
|
|
const source = readRoute("$entity/properties.tsx");
|
|
|
|
expect(source).toContain("models.property.previews.title");
|
|
expect(source).toContain("models.property.previews.emptyTitle");
|
|
expect(source).toContain("models.property.previews.emptyDescription");
|
|
expect(source).toContain("models.property.previews.rowTitle");
|
|
expect(source).toContain("models.property.previews.form");
|
|
expect(source).toContain("models.property.previews.listLayout");
|
|
expect(source).not.toContain("ui.autogenerated.previews");
|
|
expect(source).not.toContain("Add some properties to see previews");
|
|
});
|
|
});
|