Skip to content

Commit

Permalink
add props on test file
Browse files Browse the repository at this point in the history
  • Loading branch information
Terala-Priyanka committed Dec 27, 2024
1 parent 1593cd4 commit 6a719e0
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/UserSearchModal.test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,34 @@
import { screen, render } from '@folio/jest-config-stripes/testing-library/react';
import { useRef } from 'react';

import UserSearchModal from './UserSearchModal';

jest.mock('./UserSearchContainer', () => {
return jest.fn(() => <div>UserSearchContainer</div>);
});


const props = {
stripes: {
connect: jest.fn(),
okapi: {
tenant: 'diku',
},
},
selectUsers: jest.fn(),
selectUser: jest.fn(),
closeCB: jest.fn(),
onCloseModal: jest.fn(),
openWhen: true,
restoreFocus: true,
initialSelectedUsers,
tenantId: 'diku',
};
const modalRef = useRef();

describe('UserSearchModal', () => {
it('should display search label', () => {
render(<UserSearchModal />);
render(<UserSearchModal {...props, modalRef} />);

expect(screen.getByText('ui-plugin-find-user.searchFieldLabel')).toBeInTheDocument();
});
Expand Down

0 comments on commit 6a719e0

Please sign in to comment.