forked from Lilly-Protocol/lily-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsection-layout.test.tsx
More file actions
63 lines (54 loc) · 1.85 KB
/
Copy pathsection-layout.test.tsx
File metadata and controls
63 lines (54 loc) · 1.85 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { render, screen } from '@testing-library/react';
import { getSectionRoutes } from '@/config/routes';
import { SectionLayout } from './section-layout';
describe('SectionLayout', () => {
it('renders the shared shell, global nav, and section route links', () => {
render(
<SectionLayout
title="Public marketing"
description="Public-facing route group."
routes={getSectionRoutes('marketing')}
>
<div>Section content</div>
</SectionLayout>,
);
// Both SiteHeader and SiteFooter render a "Lily Protocol" brand link;
// assert at least the first one (header) points home.
const brandLinks = screen.getAllByRole("link", { name: /lily protocol/i });
expect(brandLinks.length).toBeGreaterThanOrEqual(1);
expect(brandLinks[0]).toHaveAttribute("href", "/");
expect(screen.getByRole("link", { name: /docs/i })).toHaveAttribute(
"href",
"/docs",
);
expect(screen.getByRole("link", { name: /landing page/i })).toHaveAttribute(
"href",
"/",
);
expect(screen.getByText("Section content")).toBeInTheDocument();
});
it('shows dynamic routes as non-clickable scaffold entries', () => {
render(
<SectionLayout
title="Dashboard"
description="Signed-in workspace."
routes={getSectionRoutes('dashboard')}
>
<div>Dashboard section</div>
</SectionLayout>,
);
expect(screen.getByText('/app/agents/[id]')).toBeInTheDocument();
});
it("passes automated accessibility audit with zero axe violations", async () => {
const { container } = render(
<SectionLayout
title="Public marketing"
description="Public-facing route group."
routes={getSectionRoutes("marketing")}
>
<div>Section content</div>
</SectionLayout>,
);
await checkA11y(container);
});
});