feat(HMS-3401): Add blueprints sidebar pagination

This commit is contained in:
Anna Vítová 2024-03-12 13:11:02 +01:00 committed by Lucas Garfield
parent 7bff1feaf4
commit a3a7ea88c5
9 changed files with 202 additions and 7 deletions

View file

@ -180,6 +180,43 @@ describe('Blueprints', () => {
await user.keyboard('Milk');
// wait for debounce
await waitFor(
() => {
expect(screen.getAllByRole('radio')).toHaveLength(1);
},
{
timeout: 1500,
}
);
});
});
describe('pagination', () => {
test('paging of blueprints', async () => {
renderWithReduxRouter('', {});
expect(await screen.findAllByRole('radio')).toHaveLength(10);
const option = await screen.findByTestId('blueprints-pagination-bottom');
const prevButton = within(option).getByRole('button', {
name: /Go to previous page/i,
});
const button = within(option).getByRole('button', {
name: /Go to next page/i,
});
expect(prevButton).toBeInTheDocument();
expect(prevButton).toBeVisible();
expect(prevButton).toBeDisabled();
expect(button).toBeInTheDocument();
expect(button).toBeVisible();
await waitFor(() => {
expect(button).toBeEnabled();
});
await user.click(button);
await waitFor(() => {
expect(screen.getAllByRole('radio')).toHaveLength(1);
});