File tree Expand file tree Collapse file tree
src/authz-module/components/RoleCard Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { fireEvent , screen } from '@testing-library/react' ;
1+ import { screen } from '@testing-library/react' ;
22import { renderWrapper } from '@src/setupTest' ;
3+ import userEvent from '@testing-library/user-event' ;
34import RoleCard from '.' ;
45
56jest . mock ( '@openedx/paragon/icons' , ( ) => ( {
@@ -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+ await user . click ( screen . getByText ( 'Permissions' ) ) ;
5961
6062 // Resource label
6163 expect ( screen . getByText ( 'Library Resource' ) ) . toBeInTheDocument ( ) ;
You can’t perform that action at this time.
0 commit comments