diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-04-07 22:54:27 +0200 | 
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-04-07 22:54:27 +0200 | 
| commit | 4bd651b9e32c568d86b30463858c20ef290d8c07 (patch) | |
| tree | 825e17e6b8d44d72fce01b014f4b79ae52f77d93 /src/components/molecules/buttons/heading-button.test.tsx | |
| parent | 06396f8e942c58254ee4e87f610d3e33197e0d73 (diff) | |
chore: add a HeadingButton component
Diffstat (limited to 'src/components/molecules/buttons/heading-button.test.tsx')
| -rw-r--r-- | src/components/molecules/buttons/heading-button.test.tsx | 32 | 
1 files changed, 32 insertions, 0 deletions
| diff --git a/src/components/molecules/buttons/heading-button.test.tsx b/src/components/molecules/buttons/heading-button.test.tsx new file mode 100644 index 0000000..be3865a --- /dev/null +++ b/src/components/molecules/buttons/heading-button.test.tsx @@ -0,0 +1,32 @@ +import { render, screen } from '@test-utils'; +import HeadingButton from './heading-button'; + +describe('HeadingButton', () => { +  it('renders a button to collapse.', () => { +    render( +      <HeadingButton +        level={2} +        title="The accordion title" +        expanded={true} +        setExpanded={() => null} +      /> +    ); +    expect( +      screen.getByRole('button', { name: 'Collapse The accordion title' }) +    ).toBeInTheDocument(); +  }); + +  it('renders a button to expand.', () => { +    render( +      <HeadingButton +        level={2} +        title="The accordion title" +        expanded={false} +        setExpanded={() => null} +      /> +    ); +    expect( +      screen.getByRole('button', { name: 'Expand The accordion title' }) +    ).toBeInTheDocument(); +  }); +}); | 
