aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/layout/widget.test.tsx
blob: af561eaa704cc3eca3000a5b11834f992552544a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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);
  });
});