Enable add person on People Table (#111)

Add possibility to add Person on People table
This commit is contained in:
Charles Bochet
2023-05-08 00:15:32 +02:00
committed by GitHub
parent 50a4a97145
commit 48a75358b4
11 changed files with 301 additions and 153 deletions

View File

@ -83,3 +83,24 @@ it('Checks people email edit is updating data', async () => {
expect(getByText('john@linkedin.c')).toBeInTheDocument();
});
});
it('Checks insert data is appending a new line', async () => {
const { getByText, getByTestId, container } = render(<PeopleDefault />);
await waitFor(() => {
expect(getByText('John Doe')).toBeDefined();
});
const tableRows = container.querySelectorAll<HTMLElement>('table tbody tr');
expect(tableRows.length).toBe(4);
act(() => {
fireEvent.click(getByTestId('add-button'));
});
await waitFor(() => {
const tableRows = container.querySelectorAll<HTMLElement>('table tbody tr');
expect(tableRows.length).toBe(5);
});
});