mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-06-01 10:06:17 +00:00
Move shlink-web-component tests to their own folder
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { ShortUrlFormCheckboxGroup } from '../../../src/short-urls/helpers/ShortUrlFormCheckboxGroup';
|
||||
|
||||
describe('<ShortUrlFormCheckboxGroup />', () => {
|
||||
it.each([
|
||||
[undefined, '', 0],
|
||||
['This is the tooltip', 'me-2', 1],
|
||||
])('renders tooltip only when provided', (infoTooltip, expectedClassName, expectedAmountOfTooltips) => {
|
||||
render(<ShortUrlFormCheckboxGroup infoTooltip={infoTooltip} />);
|
||||
|
||||
expect(screen.getByRole('checkbox').parentNode).toHaveAttribute(
|
||||
'class',
|
||||
expect.stringContaining(expectedClassName),
|
||||
);
|
||||
expect(screen.queryAllByRole('img', { hidden: true })).toHaveLength(expectedAmountOfTooltips);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user