Skip to content

Commit

Permalink
fix(frontend): test act warnings (#5942)
Browse files Browse the repository at this point in the history
  • Loading branch information
amanape authored Dec 31, 2024
1 parent 6f80dc5 commit e692e06
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,10 @@ describe("BaseModal", () => {
expect(screen.getByText("Save")).toBeInTheDocument();
expect(screen.getByText("Cancel")).toBeInTheDocument();

await act(async () => {
await userEvent.click(screen.getByText("Save"));
});
await userEvent.click(screen.getByText("Save"));
expect(onPrimaryClickMock).toHaveBeenCalledTimes(1);

await act(async () => {
await userEvent.click(screen.getByText("Cancel"));
});
await userEvent.click(screen.getByText("Cancel"));
expect(onSecondaryClickMock).toHaveBeenCalledTimes(1);
});

Expand All @@ -80,9 +76,7 @@ describe("BaseModal", () => {
/>,
);

await act(async () => {
await userEvent.click(screen.getByText("Save"));
});
await userEvent.click(screen.getByText("Save"));
expect(onOpenChangeMock).toHaveBeenCalledTimes(1);
});

Expand Down

0 comments on commit e692e06

Please sign in to comment.