Skip to content

Commit

Permalink
tests: add test cases for the button
Browse files Browse the repository at this point in the history
  • Loading branch information
alisher-epam committed Nov 3, 2023
1 parent c96feae commit 11bb6c9
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions lib/DonorsList/AddDonorButton.test.js
Original file line number Diff line number Diff line change
@@ -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 }) => (
<MemoryRouter>
{children}
</MemoryRouter>
);

const renderComponent = (props = {}) => (render(
<AddDonorButton
{...defaultProps}
{...props}
/>,
{ wrapper },
));

describe('AddDonorButton', () => {
it('should render component', () => {
renderComponent();

expect(screen.getByText('stripes-acq-components.donors.noFindOrganizationPlugin')).toBeDefined();
});
});

0 comments on commit 11bb6c9

Please sign in to comment.