Skip to content

Commit

Permalink
Add fixes for react 18 testing to work
Browse files Browse the repository at this point in the history
  • Loading branch information
jassmith committed Apr 5, 2022
1 parent 741227c commit dd684f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Expand Up @@ -23,9 +23,9 @@ describe("click-outside-container", () => {
const outsideElement = await result.findByText("I am outside");

expect(onClickOutside).not.toHaveBeenCalled();
userEvent.click(insideElement);
await userEvent.click(insideElement);
expect(onClickOutside).not.toHaveBeenCalled();
userEvent.click(outsideElement);
await userEvent.click(outsideElement);
expect(onClickOutside).toHaveBeenCalledTimes(1);
});
});
4 changes: 4 additions & 0 deletions packages/core/src/data-editor/data-editor.test.tsx
Expand Up @@ -198,6 +198,10 @@ function prep(resetTimers: boolean = true) {
});
if (resetTimers) {
jest.useRealTimers();
} else {
act(() => {
jest.runAllTimers();
});
}

return scroller;
Expand Down

0 comments on commit dd684f5

Please sign in to comment.