blob: 18002ae15a789c2e0fa7580651c2e93a5ff97590 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
import { render, screen } from '@testing-library/react';
import { describe, expect, test } from 'vitest';
import { Section } from './section';
describe('Section', () => {
test('renders children and forwards section attributes', () => {
render(
<Section data-testid='section' sectionClassName='py-20' className='px-4'>
<div>Body</div>
</Section>,
);
const section = screen.getByTestId('section');
expect(section.tagName).toBe('SECTION');
expect(section.className).toContain('py-20');
expect(screen.getByText('Body')).toBeInTheDocument();
});
});
|