Add new line on Table Views (#110)

Add addition on Companies table
This commit is contained in:
Charles Bochet
2023-05-07 23:41:22 +02:00
committed by GitHub
parent 8c7815af79
commit 50a4a97145
15 changed files with 329 additions and 154 deletions

View File

@ -115,3 +115,24 @@ it('Checks company address edit is updating data', async () => {
expect(getByText('21 rue de clignancourt')).toBeInTheDocument();
});
});
it('Checks insert data is appending a new line', async () => {
const { getByText, getByTestId, container } = render(<CompaniesDefault />);
await waitFor(() => {
expect(getByText('Airbnb')).toBeDefined();
});
const tableRows = container.querySelectorAll<HTMLElement>('table tbody tr');
expect(tableRows.length).toBe(6);
act(() => {
fireEvent.click(getByTestId('add-button'));
});
await waitFor(() => {
const tableRows = container.querySelectorAll<HTMLElement>('table tbody tr');
expect(tableRows.length).toBe(7);
});
});