aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/layout/section.test.tsx
blob: ca5f03a22764dabbdd9a25bf1593cd1afb3bf453 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { render, screen } from '@test-utils';
import Section from './section';

const title = 'Section title';
const content = 'Section content.';

describe('Section', () => {
  it('renders a title (h2)', () => {
    render(<Section title={title} content={content} />);
    expect(screen.getByRole('heading', { level: 2 })).toHaveTextContent(title);
  });

  it('renders a content', () => {
    render(<Section title={title} content={content} />);
    expect(screen.getByText(content)).toBeInTheDocument();
  });
});