Skip to content

Commit e7eee71

Browse files
author
Dinesh Agent
committed
Fix validation count: back to 2 (pauseValidation prevents sync call)
1 parent 6a763c7 commit e7eee71

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/Field.test.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -967,12 +967,11 @@ describe("Field", () => {
967967
)}
968968
</Form>,
969969
);
970-
// With the fix for #1050, validation runs three times:
971-
// once during synchronous registration (useState), once during normal registration (useEffect),
972-
// and once more due to form initialization
973-
expect(fooValidate).toHaveBeenCalledTimes(3);
974-
expect(barValidate).toHaveBeenCalledTimes(3);
975-
expect(bazValidate).toHaveBeenCalledTimes(3);
970+
// With the fix for #1050, validation runs twice:
971+
// once during synchronous registration (useState is paused), once during normal registration (useEffect)
972+
expect(fooValidate).toHaveBeenCalledTimes(2);
973+
expect(barValidate).toHaveBeenCalledTimes(2);
974+
expect(bazValidate).toHaveBeenCalledTimes(2);
976975
});
977976

978977
it("should warn when used without type prop and rendering radio, checkbox or multiple select indirectly", () => {

0 commit comments

Comments
 (0)