Track HiveGrid Cloud planning reference
This commit is contained in:
1 parent
b3d5ea6764
commit
e341c5938a
5784 files changed
+1104929
-3
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const sourcePath = path.resolve(process.cwd(), "apps/web/app/routes/admin/entities/$entity/danger.tsx");
|
||||
|
||||
describe("admin entity danger i18n", () => {
|
||||
it("uses semantic translation keys for danger labels and delete actions", () => {
|
||||
const source = fs.readFileSync(sourcePath, "utf8");
|
||||
|
||||
expect(source).toContain("models.entity.danger.deleteEntity");
|
||||
expect(source).toContain("models.entity.danger.deleteRows");
|
||||
expect(source).toContain("models.entity.danger.deleteRowsSuperAdminOnly");
|
||||
expect(source).toContain("shared.dangerZone");
|
||||
expect(source).toContain("shared.warningCannotUndo");
|
||||
expect(source).not.toContain("ui.autogenerated");
|
||||
expect(source).not.toContain("Delete {data.entity.title} entity");
|
||||
expect(source).not.toContain("Delete {data.count} rows");
|
||||
});
|
||||
|
||||
it("keeps entity danger count copy plural-aware in English and German", () => {
|
||||
const en = JSON.parse(fs.readFileSync(path.resolve(process.cwd(), "apps/web/public/locales/en/translations.json"), "utf8"));
|
||||
const de = JSON.parse(fs.readFileSync(path.resolve(process.cwd(), "apps/web/public/locales/de/translations.json"), "utf8"));
|
||||
|
||||
expect(en.admin.entities.errors.cannotDeleteWithRows_one).toContain("{{count}} row");
|
||||
expect(en.admin.entities.errors.cannotDeleteWithRows_other).toContain("{{count}} rows");
|
||||
expect(en.models.entity.danger.deleteRows_one).toContain("row");
|
||||
expect(en.models.entity.danger.deleteRows_other).toContain("rows");
|
||||
expect(en.models.entity.danger.deleteRowsSuperAdminOnly_one).toContain("row");
|
||||
expect(en.models.entity.danger.deleteRowsSuperAdminOnly_other).toContain("rows");
|
||||
expect(de.admin.entities.errors.cannotDeleteWithRows_one).toContain("{{count}} Datensatz vorhanden ist");
|
||||
expect(de.models.entity.danger.deleteRowsSuperAdminOnly_other).toContain("Datensätze");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user