Skip to content

Commit

Permalink
test(Button): fix case onClick
Browse files Browse the repository at this point in the history
  • Loading branch information
HytonightYX committed Aug 9, 2022
1 parent e0c74cf commit 283fef7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/core/src/components/button/tests/button.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ test('ui', () => {
expect(container.firstChild).toMatchSnapshot();
});

test('onClick', () => {
test('onClick', async () => {
const onClick = jest.fn();
render(<Button onClick={onClick}>submit</Button>);
userEvent.click(screen.getByRole('button'));
render(<button onClick={onClick}>submit</button>);
await userEvent.click(screen.getByRole('button'));
expect(onClick).toHaveBeenCalledTimes(1);
});

0 comments on commit 283fef7

Please sign in to comment.