fix: follow-ups of the lot-v018 stack reviews #482

Merged
maximus merged 25 commits from review-followups-lot-v018 into main 2026-10-21 00:31:46 +00:00
Showing only changes of commit 4f060ba7d7 - Show all commits

View file

@ -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", () => {