2022-05-06 21:01:44 +02:00
|
|
|
import { render } from '@testing-library/react';
|
2023-04-13 21:48:29 +02:00
|
|
|
import { fromPartial } from '@total-typescript/shoehorn';
|
2023-02-18 11:11:01 +01:00
|
|
|
import type { Sidebar } from '../../src/common/reducers/sidebar';
|
2022-05-28 10:47:39 +02:00
|
|
|
import { ShlinkVersionsContainer } from '../../src/common/ShlinkVersionsContainer';
|
2020-12-14 19:05:25 +01:00
|
|
|
|
|
|
|
describe('<ShlinkVersionsContainer />', () => {
|
2022-05-06 21:01:44 +02:00
|
|
|
const setUp = (sidebar: Sidebar) => render(
|
2023-04-13 21:48:29 +02:00
|
|
|
<ShlinkVersionsContainer selectedServer={fromPartial({})} sidebar={sidebar} />,
|
2022-05-06 21:01:44 +02:00
|
|
|
);
|
2020-12-14 19:05:25 +01:00
|
|
|
|
2021-09-20 22:00:34 +02:00
|
|
|
it.each([
|
2022-03-26 12:17:42 +01:00
|
|
|
[{ sidebarPresent: false }, 'text-center'],
|
|
|
|
[{ sidebarPresent: true }, 'text-center shlink-versions-container--with-sidebar'],
|
2022-03-11 16:03:15 +01:00
|
|
|
])('renders proper col classes based on sidebar status', (sidebar, expectedClasses) => {
|
2022-05-06 21:01:44 +02:00
|
|
|
const { container } = setUp(sidebar);
|
|
|
|
expect(container.firstChild).toHaveAttribute('class', `${expectedClasses}`);
|
2020-12-14 19:05:25 +01:00
|
|
|
});
|
|
|
|
});
|