Skip to content

Commit

Permalink
Fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
cdauth committed Mar 5, 2024
1 parent 964d98c commit 97c5b75
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ test("<ValidatedForm> waits for onSubmit promise", async () => {
});

const { formData } = mockForm({ onSubmit });
await sleep(0);

const form = document.querySelector('form')!;

Expand All @@ -74,6 +75,7 @@ describe("<ValidatedForm> handles validation errors", () => {
onSubmit,
validationError: undefined
});
await sleep(0);

expect(onSubmit).toBeCalledTimes(0);
await formData!.submit();
Expand All @@ -86,6 +88,7 @@ describe("<ValidatedForm> handles validation errors", () => {
onSubmit,
validationError: Promise.resolve(undefined)
});
await sleep(0);

expect(onSubmit).toBeCalledTimes(0);
await formData!.submit();
Expand All @@ -98,6 +101,7 @@ describe("<ValidatedForm> handles validation errors", () => {
onSubmit,
validationError: "Error"
});
await sleep(0);

expect(onSubmit).toBeCalledTimes(0);
await formData!.submit();
Expand All @@ -110,6 +114,7 @@ describe("<ValidatedForm> handles validation errors", () => {
onSubmit,
validationError: Promise.resolve("Error")
});
await sleep(0);

expect(onSubmit).toBeCalledTimes(0);
await formData!.submit();
Expand Down

0 comments on commit 97c5b75

Please sign in to comment.