Skip to content

Commit

Permalink
test: add tests for rendering hidden object/array
Browse files Browse the repository at this point in the history
  • Loading branch information
epicfaace committed Jan 19, 2019
1 parent 863912d commit e4e67ad
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/ArrayField_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ describe("ArrayField", () => {
expect(description.id).eql("root__description");
});

it("should render a hidden list", () => {
const { node } = createFormComponent({
schema,
uiSchema: {
"ui:widget": "hidden",
},
});
expect(node.querySelector("div.hidden > fieldset")).to.exist;
});

it("should render a customized title", () => {
const CustomTitleField = ({ title }) => <div id="custom">{title}</div>;

Expand Down
10 changes: 10 additions & 0 deletions test/ObjectField_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ describe("ObjectField", () => {
expect(legend.id).eql("root__title");
});

it("should render a hidden object", () => {
const { node } = createFormComponent({
schema,
uiSchema: {
"ui:widget": "hidden",
},
});
expect(node.querySelector("div.hidden > fieldset")).to.exist;
});

it("should render a customized title", () => {
const CustomTitleField = ({ title }) => <div id="custom">{title}</div>;

Expand Down

0 comments on commit e4e67ad

Please sign in to comment.