# Frontend Unit Tests
This directory contains unit tests for individual React components, contexts, and pages.
## Structure
```
unit_tests/
├── HeaderNav.test.tsx # Tests for HeaderNav component
├── FilterBar.test.tsx # Tests for FilterBar component
├── ExportModal.test.tsx # Tests for ExportModal component
├── FilterContext.test.tsx # Tests for FilterContext
├── HelpPage.test.tsx # Tests for HelpPage
└── README.md # This file
```
## Test Categories
### Component Tests
- **HeaderNav.test.tsx**: Tests navigation rendering, logo display, and button presence
- **FilterBar.test.tsx**: Tests filter controls, input rendering, and loading states
- **ExportModal.test.tsx**: Tests export modal functionality, bulk/single modes, and user interactions
### Context Tests
- **FilterContext.test.tsx**: Tests FilterContext state management, updates, and provider functionality
### Page Tests
- **HelpPage.test.tsx**: Tests help page content, sections, and action buttons
## Running Unit Tests
```bash
# Run all unit tests
npm run test:unit
# Run unit tests in watch mode
npm run test:unit:watch
# Run unit tests with coverage
npm run test:unit:coverage
```
## Test Patterns
### Component Testing
```typescript
import { render, screen } from '@testing-library/react'
import { describe, it, expect, vi } from 'vitest'
import ComponentName from '../../components/ComponentName'
describe('ComponentName', () => {
it('renders without crashing', () => {
render(