45 lines
1.9 KiB
TypeScript
45 lines
1.9 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { readMergedLocaleNamespace } from "~/utils/testing/repoPaths";
|
|
|
|
type ChatAuditTranslations = {
|
|
chat: {
|
|
audit: {
|
|
description: string;
|
|
dmBanner: string;
|
|
actions: Record<string, string>;
|
|
administration: Record<string, string>;
|
|
members: { title: string; role: Record<string, string> };
|
|
confirm: { archive: Record<string, string>; remove: Record<string, string> };
|
|
};
|
|
};
|
|
};
|
|
|
|
function readTranslations(locale: "de" | "de-formal" | "en"): ChatAuditTranslations {
|
|
return readMergedLocaleNamespace<ChatAuditTranslations>(locale, "translations");
|
|
}
|
|
|
|
describe("AK-P15b chat admin audit translations", () => {
|
|
it("keeps cleanup and force-member copy complete in every shipped locale", () => {
|
|
const catalogs = [readTranslations("de"), readTranslations("de-formal"), readTranslations("en")];
|
|
for (const catalog of catalogs) {
|
|
const audit = catalog.chat.audit;
|
|
expect(audit.description).toBeTruthy();
|
|
expect(audit.dmBanner).toBeTruthy();
|
|
expect(Object.keys(audit.actions).sort()).toEqual(["archive", "archiveLabel", "demote", "promote", "removeMemberLabel"]);
|
|
expect(Object.keys(audit.members.role).sort()).toEqual(["admin", "member"]);
|
|
expect(Object.keys(audit.confirm.archive).sort()).toEqual(["body", "bodyNamed", "title"]);
|
|
expect(Object.keys(audit.confirm.remove).sort()).toEqual(["body", "title"]);
|
|
}
|
|
});
|
|
|
|
it("uses formal German address in destructive-action explanations", () => {
|
|
const informal = readTranslations("de").chat.audit;
|
|
const formal = readTranslations("de-formal").chat.audit;
|
|
expect(informal.confirm.archive.body).toContain("deiner");
|
|
expect(formal.confirm.archive.body).toContain("Ihrer");
|
|
expect(informal.administration.readOnlyDescription).toContain("Du");
|
|
expect(formal.administration.readOnlyDescription).toContain("Sie");
|
|
});
|
|
});
|