From 11bb6c91e3fe5828b068fa15b6268d8eb635e6f0 Mon Sep 17 00:00:00 2001 From: Alisher Musurmonov Date: Fri, 3 Nov 2023 16:51:28 +0500 Subject: [PATCH] tests: add test cases for the button --- lib/DonorsList/AddDonorButton.test.js | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 lib/DonorsList/AddDonorButton.test.js diff --git a/lib/DonorsList/AddDonorButton.test.js b/lib/DonorsList/AddDonorButton.test.js new file mode 100644 index 00000000..142c89b8 --- /dev/null +++ b/lib/DonorsList/AddDonorButton.test.js @@ -0,0 +1,35 @@ +import { MemoryRouter } from 'react-router-dom'; +import { render, screen } from '@testing-library/react'; + +import AddDonorButton from './AddDonorButton'; + +const mockOnAddDonors = jest.fn(); + +const defaultProps = { + onAddDonors: mockOnAddDonors, + fields: {}, + stripes: {}, + name: 'donors', +}; + +const wrapper = ({ children }) => ( + + {children} + +); + +const renderComponent = (props = {}) => (render( + , + { wrapper }, +)); + +describe('AddDonorButton', () => { + it('should render component', () => { + renderComponent(); + + expect(screen.getByText('stripes-acq-components.donors.noFindOrganizationPlugin')).toBeDefined(); + }); +});