fix unit tests

This commit is contained in:
Ashley Harrison 2022-12-19 13:43:53 +00:00
parent c0cd5822da
commit eb40f3207a
No known key found for this signature in database
GPG Key ID: AEC29E54E8D7CD90
2 changed files with 3 additions and 5 deletions

View File

@ -97,9 +97,7 @@ describe('AccordianKeyValues test', () => {
it('renders the summary instead of the table when it is not expanded', () => {
setupAccordian({ isOpen: false } as AccordianKeyValuesProps);
expect(
screen.getByRole('switch', { name: 'test accordian: span.kind = client omg = mos-def' })
).toBeInTheDocument();
expect(screen.getByRole('switch', { name: 'test accordian: span.kind = clientomg = mos-def' })).toBeInTheDocument();
expect(screen.queryByRole('table')).not.toBeInTheDocument();
expect(screen.queryAllByRole('cell')).toHaveLength(0);
});

View File

@ -196,9 +196,9 @@ describe('NavBarItem', () => {
expect(screen.getAllByRole('menuitem')[2]).toHaveAttribute('tabIndex', '-1');
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')[0]).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');
});