Files
HiveGrid-Wireframes/hivegrid-cloud/apps/web/app/utils/helpers/row-display-header-i18n.test.ts
T

33 lines
1.6 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { readRepoFile } from "~/utils/testing/repoPaths";
describe("row display header i18n guards", () => {
it("keeps row, relationship, and formula labels behind model translation helpers", () => {
const source = [
"apps/web/app/utils/helpers/RowDisplayHeaderHelper.tsx",
"apps/web/app/components/entities/rows/RowsListAndTable.tsx",
"apps/web/app/components/entities/rows/RowCard.tsx",
"apps/web/app/components/entities/rows/RowsRelationships.tsx",
"apps/web/app/components/entities/rows/cells/RowRelationshipRowsByEntity.tsx",
"apps/web/app/components/entities/rows/RowForm.tsx",
"apps/web/app/components/entities/rows/RowValueInput.tsx",
]
.map((file) => readRepoFile(file))
.join("\n");
expect(source).toContain("translatePropertyTitle");
expect(source).toContain("translateEntityTitle");
expect(source).toContain("translateEntityTitlePlural");
expect(source).toContain("translateLabel(t, i18n, header.title)");
expect(source).not.toContain("title: property.title");
expect(source).not.toContain("title: parentEntity.title");
expect(source).not.toContain("title: childEntity.titlePlural");
expect(source).not.toContain("t(entity.title)");
expect(source).not.toContain("t(relationship.parent.title)");
expect(source).not.toContain("t(relationship.child.title)");
expect(source).not.toContain("title={props.property.title}");
expect(source).not.toContain(">Admin<");
expect(source).toContain('t("shared.admin")');
});
});