feat(HMS-3401): Add blueprints sidebar pagination
This commit is contained in:
parent
7bff1feaf4
commit
a3a7ea88c5
9 changed files with 202 additions and 7 deletions
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue