Skip to content
Draft
11 changes: 7 additions & 4 deletions src/components/editorFormSerialization.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ function submittedValue(
}

async function dispatchReset(form: HTMLFormElement): Promise<boolean> {
const allowed = form.dispatchEvent(
new Event('reset', { bubbles: true, cancelable: true }),
);
await new Promise<void>((resolve) => setTimeout(resolve, 0));
let allowed = false;
await act(async () => {
allowed = form.dispatchEvent(
new Event('reset', { bubbles: true, cancelable: true }),
);
await new Promise<void>((resolve) => setTimeout(resolve, 0));
});
return allowed;
}

Expand Down
Loading