Skip to content

Commit

Permalink
test: bug in getChildSchemaSelection
Browse files Browse the repository at this point in the history
  • Loading branch information
sagold committed Dec 1, 2024
1 parent 19fa477 commit e90675f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/unit/getChildSchemaSelection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit e90675f

Please sign in to comment.