-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDualScrollSyncContentSection.test.tsx
More file actions
40 lines (32 loc) · 1.15 KB
/
DualScrollSyncContentSection.test.tsx
File metadata and controls
40 lines (32 loc) · 1.15 KB
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
33
34
35
36
37
38
39
40
import { render } from '@testing-library/react';
import { vi } from 'vitest';
import { DualScrollSyncContentSection } from './DualScrollSyncContentSection';
describe('DualScrollSyncContentSection', () => {
afterEach(() => {
vi.clearAllMocks();
});
it('should render with correct label and sectionKey', () => {
const { getByTestId, getByText } = render(
<DualScrollSyncContentSection sectionKey="test-section">
<div>Test Content</div>
</DualScrollSyncContentSection>
);
const contentSection = getByTestId('test-content-id-section-test-section');
expect(contentSection).toBeInTheDocument();
expect(getByText('Test Content')).toBeInTheDocument();
});
it('should apply custom className and style', () => {
const { getByTestId } = render(
<DualScrollSyncContentSection
sectionKey="styled-section"
className="custom-class"
style={{ borderWidth: '1px' }}
>
<div>Styled Content</div>
</DualScrollSyncContentSection>
);
const contentSection = getByTestId('test-content-id-section-styled-section');
expect(contentSection).toHaveClass('custom-class');
expect(contentSection).toHaveStyle({ borderWidth: '1px' });
});
});