diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-04-15 15:34:21 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-04-15 16:26:29 +0200 |
| commit | 6ec16bc15cc78e62cb94e131699625fa5363437c (patch) | |
| tree | 8090c2a611fbec2e79f49422c1ca582fa33c5248 /src/components/molecules/layout/widget.test.tsx | |
| parent | 64570357f9608ad6638b1f8cc283ee9dd1cc3264 (diff) | |
chore: add a Widget component
Diffstat (limited to 'src/components/molecules/layout/widget.test.tsx')
| -rw-r--r-- | src/components/molecules/layout/widget.test.tsx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/components/molecules/layout/widget.test.tsx b/src/components/molecules/layout/widget.test.tsx new file mode 100644 index 0000000..af561ea --- /dev/null +++ b/src/components/molecules/layout/widget.test.tsx @@ -0,0 +1,19 @@ +import { render, screen } from '@test-utils'; +import Widget from './widget'; + +const children = 'Widget body'; +const title = 'Widget title'; +const titleLevel = 2; + +describe('Widget', () => { + it('renders the widget title', () => { + render( + <Widget expanded={true} title={title} level={titleLevel}> + {children} + </Widget> + ); + expect( + screen.getByRole('heading', { level: titleLevel }) + ).toHaveTextContent(title); + }); +}); |
