Skip to content

Commit 8c4707a

Browse files
committed
Refs rjsf-team#442: Fix erroneous test cases.
1 parent ffc1737 commit 8c4707a

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

test/StringField_test.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ describe("StringField", () => {
7878
});
7979

8080
it("should handle an empty string change event", () => {
81-
const {comp, node} = createFormComponent({schema: {
82-
type: "string",
83-
}});
81+
const {comp, node} = createFormComponent({
82+
schema: {type: "string"},
83+
formData: "x",
84+
});
8485

8586
Simulate.change(node.querySelector("input"), {
8687
target: {value: ""}
@@ -217,11 +218,13 @@ describe("StringField", () => {
217218

218219
describe("TextareaWidget", () => {
219220
it("should handle an empty string change event", () => {
220-
const {comp, node} = createFormComponent({schema: {
221-
type: "string",
222-
}});
221+
const {comp, node} = createFormComponent({
222+
schema: {type: "string"},
223+
uiSchema: {"ui:widget": "textarea"},
224+
formData: "x",
225+
});
223226

224-
Simulate.change(node.querySelector("input"), {
227+
Simulate.change(node.querySelector("textarea"), {
225228
target: {value: ""}
226229
});
227230

0 commit comments

Comments
 (0)