blob: d64283ae457916373d834660dd0d13a9ff2ba87c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
import { render, screen } from '../../../../tests/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();
});
});
|