Skip to content

Commit be0ccae

Browse files
committed
test: update fireEvent with useEvent
1 parent 71d4c3a commit be0ccae

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/authz-module/components/RoleCard/index.test.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { fireEvent, screen } from '@testing-library/react';
1+
import { screen } from '@testing-library/react';
22
import { renderWrapper } from '@src/setupTest';
33
import RoleCard from '.';
4+
import userEvent from '@testing-library/user-event';
45

56
jest.mock('@openedx/paragon/icons', () => ({
67
Delete: () => <svg data-testid="delete-icon" />,
@@ -33,7 +34,8 @@ describe('RoleCard', () => {
3334
],
3435
};
3536

36-
it('renders all role card sections correctly', () => {
37+
it('renders all role card sections correctly', async () => {
38+
const user = userEvent.setup();
3739
renderWrapper(<RoleCard {...defaultProps} />);
3840

3941
// Title
@@ -55,7 +57,7 @@ describe('RoleCard', () => {
5557
// Collapsible title
5658
expect(screen.getByText('Permissions')).toBeInTheDocument();
5759

58-
fireEvent.click(screen.getByText('Permissions'));
60+
user.click(screen.getByText('Permissions'));
5961

6062
// Resource label
6163
expect(screen.getByText('Library Resource')).toBeInTheDocument();

0 commit comments

Comments
 (0)