fix: follow-ups of the lot-v018 stack reviews #482
1 changed files with 5 additions and 1 deletions
|
|
@ -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", () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue