From e90675f9a2c3185f23bf44c9bfd822f264278f71 Mon Sep 17 00:00:00 2001 From: Sascha Goldhofer Date: Sun, 1 Dec 2024 23:09:19 +0100 Subject: [PATCH] test: bug in getChildSchemaSelection --- test/unit/getChildSchemaSelection.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/unit/getChildSchemaSelection.test.ts b/test/unit/getChildSchemaSelection.test.ts index 217ac7e..7249be3 100644 --- a/test/unit/getChildSchemaSelection.test.ts +++ b/test/unit/getChildSchemaSelection.test.ts @@ -29,6 +29,15 @@ describe("getChildSchemaSelection", () => { expect(result).to.deep.eq([{ type: "string" }]); }); + it("should return an empty array if items schema is undefined", () => { + const result = getChildSchemaSelection(draft, 2, { + type: "array", + items: [{ type: "string" }, { type: "number" }] + }); + + expect(result).to.have.length(0); + }); + it("should return list of oneOf elements", () => { const result = getChildSchemaSelection(draft, "b", { type: "array",