forked from Lilly-Protocol/lily-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub-20-Lilly-Protocol-lily-frontend.tsx
More file actions
35 lines (30 loc) · 1.3 KB
/
Copy pathgithub-20-Lilly-Protocol-lily-frontend.tsx
File metadata and controls
35 lines (30 loc) · 1.3 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
import React from 'react';
import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom';
import PageScaffold from './PageScaffold';
describe('PageScaffold', () => {
describe('dynamicLabel', () => {
it('renders default label when dynamicLabel is not provided', () => {
render(<PageScaffold>Content</PageScaffold>);
expect(screen.getByText('Page')).toBeInTheDocument();
});
it('renders custom dynamicLabel when provided', () => {
render(<PageScaffold dynamicLabel="Custom Label">Content</PageScaffold>);
expect(screen.getByText('Custom Label')).toBeInTheDocument();
});
it('does not render label when dynamicLabel is null', () => {
render(<PageScaffold dynamicLabel={null}>Content</PageScaffold>);
expect(screen.queryByText('Page')).not.toBeInTheDocument();
});
});
describe('sectionEyebrow', () => {
it('renders section eyebrow when provided', () => {
render(<PageScaffold sectionEyebrow="New Feature">Content</PageScaffold>);
expect(screen.getByText('New Feature')).toBeInTheDocument();
});
it('does not render section eyebrow when not provided', () => {
render(<PageScaffold>Content</PageScaffold>);
expect(screen.queryByText(/New Feature|Section/i)).not.toBeInTheDocument();
});
});
});