mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix unit tests
This commit is contained in:
parent
c0cd5822da
commit
eb40f3207a
@ -97,9 +97,7 @@ describe('AccordianKeyValues test', () => {
|
|||||||
it('renders the summary instead of the table when it is not expanded', () => {
|
it('renders the summary instead of the table when it is not expanded', () => {
|
||||||
setupAccordian({ isOpen: false } as AccordianKeyValuesProps);
|
setupAccordian({ isOpen: false } as AccordianKeyValuesProps);
|
||||||
|
|
||||||
expect(
|
expect(screen.getByRole('switch', { name: 'test accordian: span.kind = clientomg = mos-def' })).toBeInTheDocument();
|
||||||
screen.getByRole('switch', { name: 'test accordian: span.kind = client omg = mos-def' })
|
|
||||||
).toBeInTheDocument();
|
|
||||||
expect(screen.queryByRole('table')).not.toBeInTheDocument();
|
expect(screen.queryByRole('table')).not.toBeInTheDocument();
|
||||||
expect(screen.queryAllByRole('cell')).toHaveLength(0);
|
expect(screen.queryAllByRole('cell')).toHaveLength(0);
|
||||||
});
|
});
|
||||||
|
@ -196,9 +196,9 @@ describe('NavBarItem', () => {
|
|||||||
expect(screen.getAllByRole('menuitem')[2]).toHaveAttribute('tabIndex', '-1');
|
expect(screen.getAllByRole('menuitem')[2]).toHaveAttribute('tabIndex', '-1');
|
||||||
|
|
||||||
await userEvent.keyboard('{ArrowLeft}');
|
await userEvent.keyboard('{ArrowLeft}');
|
||||||
expect(screen.getAllByRole('link')[0]).toHaveFocus();
|
expect((await screen.findAllByRole('link'))[0]).toHaveFocus();
|
||||||
expect(screen.getAllByRole('menuitem')).toHaveLength(3);
|
expect(screen.getAllByRole('menuitem')).toHaveLength(3);
|
||||||
expect(screen.getAllByRole('menuitem')[0]).toHaveAttribute('tabIndex', '-1');
|
expect(screen.getAllByRole('menuitem')[1]).toHaveAttribute('tabIndex', '-1');
|
||||||
expect(screen.getAllByRole('menuitem')[1]).toHaveAttribute('tabIndex', '-1');
|
expect(screen.getAllByRole('menuitem')[1]).toHaveAttribute('tabIndex', '-1');
|
||||||
expect(screen.getAllByRole('menuitem')[2]).toHaveAttribute('tabIndex', '-1');
|
expect(screen.getAllByRole('menuitem')[2]).toHaveAttribute('tabIndex', '-1');
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user