From 55716a8f7f05fe25513598d3c4d6e587830b6869 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Wed, 23 Jun 2021 19:59:06 +0200 Subject: [PATCH] Created ShortUrlFormCheckboxGroup test --- .../helpers/ShortUrlFormCheckboxGroup.test.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/short-urls/helpers/ShortUrlFormCheckboxGroup.test.tsx diff --git a/test/short-urls/helpers/ShortUrlFormCheckboxGroup.test.tsx b/test/short-urls/helpers/ShortUrlFormCheckboxGroup.test.tsx new file mode 100644 index 00000000..76df7496 --- /dev/null +++ b/test/short-urls/helpers/ShortUrlFormCheckboxGroup.test.tsx @@ -0,0 +1,16 @@ +import { shallow } from 'enzyme'; +import { ShortUrlFormCheckboxGroup } from '../../../src/short-urls/helpers/ShortUrlFormCheckboxGroup'; +import Checkbox from '../../../src/utils/Checkbox'; + +describe('', () => { + test.each([ + [ undefined, '', 0 ], + [ 'This is the tooltip', 'mr-2', 1 ], + ])('renders tooltip only when provided', (infoTooltip, expectedClassName, expectedAmountOfTooltips) => { + const wrapper = shallow(); + const checkbox = wrapper.find(Checkbox); + + expect(checkbox.prop('className')).toEqual(expectedClassName); + expect(wrapper.find('InfoTooltip')).toHaveLength(expectedAmountOfTooltips); + }); +});