-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.test.tsx
More file actions
32 lines (26 loc) · 1.24 KB
/
Copy pathApp.test.tsx
File metadata and controls
32 lines (26 loc) · 1.24 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
import { describe, it, expect } from 'vitest';
import { render, screen } from '@testing-library/react';
import App from './App';
describe('App', () => {
it('renders main sections', () => {
render(<App />);
expect(screen.getByRole('main')).toBeInTheDocument();
expect(screen.getByRole('heading', { name: /Proof of Impact/i })).toBeInTheDocument();
expect(screen.getByRole('heading', { name: /Case Studies/i })).toBeInTheDocument();
expect(screen.getByRole('heading', { name: /Skills & Expertise/i })).toBeInTheDocument();
expect(screen.getByRole('heading', { name: /Education/i })).toBeInTheDocument();
expect(screen.getByRole('heading', { name: /Latest Thoughts/i })).toBeInTheDocument();
});
it('renders chat trigger button', () => {
render(<App />);
expect(screen.getByRole('button', { name: /open chat/i })).toBeInTheDocument();
});
it('places projects before current-focus content', () => {
render(<App />);
const projectsHeading = screen.getByRole('heading', { name: /Case Studies/i });
const nowNextHeading = screen.getByRole('heading', { name: /Now & Next/i });
expect(
projectsHeading.compareDocumentPosition(nowNextHeading) & Node.DOCUMENT_POSITION_FOLLOWING
).toBeTruthy();
});
});