diff --git a/src/i18n/locales.keys.test.ts b/src/i18n/locales.keys.test.ts index 8ae7796..03173c0 100644 --- a/src/i18n/locales.keys.test.ts +++ b/src/i18n/locales.keys.test.ts @@ -68,7 +68,9 @@ const EN = nodesOf(en); describe("locale keys: fr.json and en.json (#453)", () => { it("reads both files whole, array items included", () => { - // The canary: an empty or unread file would make the comparison pass on nothing. + // The canary: an empty or unread file would make the comparison pass on + // nothing, and so would one file imported twice. + expect(en, "en.json and fr.json are two modules").not.toBe(fr); for (const [name, nodes] of [["fr.json", FR], ["en.json", EN]] as const) { expect(nodes.get("common.cancel"), name).toBe("leaf"); expect(nodes.get("dashboard.help.tips"), name).toBe("array"); @@ -95,6 +97,8 @@ describe("locale keys: the comparison (#453)", () => { const b = nodesOf({ list: ["one"], only: { b: "y" } }); expect(missingKeys(a, b)).toEqual(["list.1", "only.a"]); expect(missingKeys(b, a)).toEqual(["only.b"]); + // Leaves only: the container `zz` of a missing branch is not listed. + expect(missingKeys(nodesOf({ zz: { only: "x" } }), nodesOf({}))).toEqual(["zz.only"]); }); it("holds an array against an object with the same indices as a gap", () => {