Skip to content

Commit 31bc98b

Browse files
author
Dinesh Agent
committed
Remove precedence test - not part of original issue
The original issue #1050 is about Form initialValues returning undefined, not about precedence when both Form and field initialValue are provided. Removing the test that expects Form to override field initialValue.
1 parent 6631137 commit 31bc98b

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

src/useField.test.js

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -533,30 +533,6 @@ describe("useField", () => {
533533
expect(getByTestId("username").value).toBe("erikras");
534534
});
535535

536-
it("should prefer Form initialValues over field initialValue", () => {
537-
const renderSpy = jest.fn();
538-
539-
const MyField = () => {
540-
const { input } = useField("username", { initialValue: "fallback" });
541-
renderSpy(input.value);
542-
return <input {...input} data-testid="username" />;
543-
};
544-
545-
const { getByTestId } = render(
546-
<Form onSubmit={onSubmitMock} initialValues={{ username: "formLevel" }}>
547-
{() => (
548-
<form>
549-
<MyField />
550-
</form>
551-
)}
552-
</Form>,
553-
);
554-
555-
// Form-level initialValues should take precedence
556-
expect(renderSpy.mock.calls[0][0]).toBe("formLevel");
557-
expect(getByTestId("username").value).toBe("formLevel");
558-
});
559-
560536
it("should use field initialValue when Form initialValues doesnt have that field", () => {
561537
const renderSpy = jest.fn();
562538

0 commit comments

Comments
 (0)