2022-05-03 18:03:14 +02:00
|
|
|
import { render, screen } from '@testing-library/react';
|
2023-04-13 21:48:29 +02:00
|
|
|
import { fromPartial } from '@total-typescript/shoehorn';
|
2023-05-27 11:57:26 +02:00
|
|
|
import { MemoryRouter } from 'react-router';
|
2023-07-15 13:14:49 +02:00
|
|
|
import { AsideMenu } from '../../src/common/AsideMenu';
|
2022-02-07 22:17:57 +01:00
|
|
|
|
2018-08-12 08:49:08 +02:00
|
|
|
describe('<AsideMenu />', () => {
|
2023-07-15 13:14:49 +02:00
|
|
|
const setUp = () => render(
|
2022-05-03 18:03:14 +02:00
|
|
|
<MemoryRouter>
|
2023-07-15 13:14:49 +02:00
|
|
|
<AsideMenu selectedServer={fromPartial({ id: 'abc123', version: '2.8.0' })} />
|
2022-05-03 18:03:14 +02:00
|
|
|
</MemoryRouter>,
|
|
|
|
);
|
2018-12-17 22:32:51 +01:00
|
|
|
|
2022-12-23 20:42:47 +01:00
|
|
|
it('contains links to different sections', () => {
|
|
|
|
setUp();
|
2018-08-12 08:49:08 +02:00
|
|
|
|
2022-05-03 18:03:14 +02:00
|
|
|
const links = screen.getAllByRole('link');
|
2018-08-12 08:49:08 +02:00
|
|
|
|
2022-05-03 18:03:14 +02:00
|
|
|
expect.assertions(links.length + 1);
|
2023-07-15 13:14:49 +02:00
|
|
|
expect(links).toHaveLength(5);
|
2022-05-03 18:03:14 +02:00
|
|
|
links.forEach((link) => expect(link.getAttribute('href')).toContain('abc123'));
|
2018-08-12 08:49:08 +02:00
|
|
|
});
|
|
|
|
});
|