mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2025-01-10 18:27:25 +03:00
Created ShortUrlFormCheckboxGroup test
This commit is contained in:
parent
5ef719c592
commit
55716a8f7f
1 changed files with 16 additions and 0 deletions
16
test/short-urls/helpers/ShortUrlFormCheckboxGroup.test.tsx
Normal file
16
test/short-urls/helpers/ShortUrlFormCheckboxGroup.test.tsx
Normal file
|
@ -0,0 +1,16 @@
|
|||
import { shallow } from 'enzyme';
|
||||
import { ShortUrlFormCheckboxGroup } from '../../../src/short-urls/helpers/ShortUrlFormCheckboxGroup';
|
||||
import Checkbox from '../../../src/utils/Checkbox';
|
||||
|
||||
describe('<ShortUrlFormCheckboxGroup />', () => {
|
||||
test.each([
|
||||
[ undefined, '', 0 ],
|
||||
[ 'This is the tooltip', 'mr-2', 1 ],
|
||||
])('renders tooltip only when provided', (infoTooltip, expectedClassName, expectedAmountOfTooltips) => {
|
||||
const wrapper = shallow(<ShortUrlFormCheckboxGroup infoTooltip={infoTooltip} />);
|
||||
const checkbox = wrapper.find(Checkbox);
|
||||
|
||||
expect(checkbox.prop('className')).toEqual(expectedClassName);
|
||||
expect(wrapper.find('InfoTooltip')).toHaveLength(expectedAmountOfTooltips);
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue