From 6be20422494e3806fba3d1c5ad5c3e98bd6e67e5 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Wed, 1 Jun 2022 19:34:43 +0200 Subject: chore: replace the Ackee select by a toggle component --- src/components/molecules/forms/fieldset.test.tsx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/components/molecules/forms/fieldset.test.tsx (limited to 'src/components/molecules/forms/fieldset.test.tsx') diff --git a/src/components/molecules/forms/fieldset.test.tsx b/src/components/molecules/forms/fieldset.test.tsx new file mode 100644 index 0000000..de89e31 --- /dev/null +++ b/src/components/molecules/forms/fieldset.test.tsx @@ -0,0 +1,22 @@ +import { render, screen } from '@test-utils'; +import Fieldset from './fieldset'; +import { body, legend, Tooltip } from './fieldset.fixture'; + +describe('Fieldset', () => { + // Cannot use toBeInTheDocument because of body is not an HTMLElement. + + it('renders a legend and a body', () => { + render(
{body}
); + expect(screen.findByRole('group', { name: legend })).toBeTruthy(); + expect(screen.findByText(body)).toBeTruthy(); + }); + + it('renders a button to open a tooltip', () => { + render( +
+ {body} +
+ ); + expect(screen.findByRole('button', { name: /Help/i })).toBeTruthy(); + }); +}); -- cgit v1.2.3