← back to Wine Finder Next

TEST_FILE_INDEX.md

264 lines

# Test Suite File Index

Complete index of all test files and documentation.

## Test Files (11 files)

### Configuration Files
1. `/jest.config.js` - Jest test configuration
2. `/jest.setup.js` - Jest setup and globals
3. `/playwright.config.ts` - Playwright E2E configuration
4. `/package.json` - Test scripts (updated)

### Unit Tests (2 files, 70+ tests)
5. `/__tests__/unit/inputValidation.test.ts` (35+ tests)
   - Bottle/vote/unit ID validation
   - Email, price, quantity validation
   - String sanitization
   - Address validation
   - Schema validation

6. `/__tests__/unit/membershipDatabase.test.ts` (35+ tests)
   - Bottle CRUD operations
   - Membership unit management
   - Governance voting
   - Marketplace operations
   - Vote execution

### Integration Tests (3 files, 30+ tests)
7. `/__tests__/integration/api-bottles.test.ts` (10+ tests)
   - GET/POST /api/membership/bottles
   - Rate limiting
   - Security detection
   - Input sanitization

8. `/__tests__/integration/api-marketplace.test.ts` (10+ tests)
   - GET/POST /api/membership/marketplace
   - Filtering and validation
   - Listing operations

9. `/__tests__/integration/api-votes.test.ts` (10+ tests)
   - GET/POST /api/membership/votes
   - Vote casting
   - Security checks

### Security Tests (1 file, 50+ tests)
10. `/__tests__/security/security-vulnerabilities.test.ts` (50+ tests)
    - SQL Injection (10 tests)
    - XSS Prevention (10 tests)
    - Command Injection (5 tests)
    - Path Traversal (5 tests)
    - CSRF, NoSQL, Header, File Upload, etc. (20 tests)

### Performance Tests (1 file, 15+ tests)
11. `/__tests__/performance/load-testing.test.ts` (15+ tests)
    - API response times
    - Concurrent requests
    - Memory leak detection
    - Stress testing

### E2E Tests (1 file, 25+ tests)
12. `/e2e/membership-flows.spec.ts` (25+ tests)
    - Bottle purchase flow (5 tests)
    - Governance voting (6 tests)
    - Marketplace trading (5 tests)
    - Mobile responsiveness (3 tests)
    - Error handling (3 tests)
    - Accessibility (3 tests)

### Support Files (2 files)
13. `/__tests__/fixtures/testData.ts`
    - Mock bottles, units, votes, listings
    - Factory functions
    - Security payloads

14. `/__tests__/helpers/testUtils.ts`
    - Request utilities
    - Performance monitoring
    - Database helpers
    - Security testing utilities
    - Async helpers

### CI/CD (1 file)
15. `/.github/workflows/test-automation.yml`
    - GitHub Actions workflow
    - Automated testing pipeline
    - Coverage reporting
    - Multi-job test execution

### Scripts (1 file)
16. `/run-tests.sh`
    - Executable test runner
    - Color-coded output
    - Multiple test modes
    - Help documentation

## Documentation Files (6 files)

### Quick Reference
1. `/TEST_README.md` (1.2K)
   - Quick overview
   - Basic commands
   - Getting started

2. `/TESTING_QUICK_START.md` (6.0K)
   - Detailed quick start
   - Common commands
   - Test patterns
   - Troubleshooting

### Complete Reference
3. `/TEST_SUITE_DOCUMENTATION.md` (8.9K)
   - Complete test suite reference
   - Test patterns and best practices
   - CI/CD integration
   - Debugging instructions

4. `/TEST_SUMMARY.md` (9.9K)
   - Test overview
   - File structure
   - Coverage goals
   - Maintenance guide

5. `/COMPREHENSIVE_TEST_OVERVIEW.md` (16K)
   - Detailed breakdown
   - All test details
   - Metrics and standards
   - Complete documentation

### Checklists
6. `/TEST_CHECKLIST.md`
   - Implementation checklist
   - Feature coverage
   - Completion status

## File Sizes

```
Configuration:        ~3K total
Test Files:           ~3,130 lines
Support Files:        ~2,000 lines
Documentation:        ~50K total
Total Project:        ~55K+ test-related content
```

## Key Locations

### Run Tests
```bash
cd /root/Projects/wine-finder-next
npm test                    # Watch mode
npm run test:all           # All tests
./run-tests.sh all         # Using script
```

### View Coverage
```bash
npm run test:coverage
open coverage/lcov-report/index.html
```

### E2E Tests
```bash
npm run test:e2e          # Run E2E
npm run test:e2e:ui       # With UI
npm run test:e2e:report   # View report
```

### Specific Categories
```bash
npm run test:unit
npm run test:integration
npm run test:security
npm run test:performance
```

## Navigation Guide

**New to the test suite?**
→ Start with `/TEST_README.md`

**Want to run tests quickly?**
→ See `/TESTING_QUICK_START.md`

**Need complete reference?**
→ Read `/TEST_SUITE_DOCUMENTATION.md`

**Looking for specific tests?**
→ Check `/TEST_SUMMARY.md`

**Want detailed breakdown?**
→ See `/COMPREHENSIVE_TEST_OVERVIEW.md`

**Checking implementation status?**
→ Review `/TEST_CHECKLIST.md`

## Test Commands Reference

```bash
# Development
npm test                    # Watch mode

# By Category
npm run test:unit          # Unit tests
npm run test:integration   # Integration tests
npm run test:security      # Security tests
npm run test:performance   # Performance tests
npm run test:e2e          # E2E tests

# Coverage
npm run test:coverage      # Generate coverage

# CI/CD
npm run test:ci           # CI mode
npm run test:all          # All tests

# E2E Modes
npm run test:e2e:ui       # Interactive UI
npm run test:e2e:report   # View report

# Using Script
./run-tests.sh unit        # Unit tests
./run-tests.sh all         # All tests
./run-tests.sh help        # Show help
```

## Directory Structure

```
wine-finder-next/
├── __tests__/
│   ├── fixtures/
│   │   └── testData.ts
│   ├── helpers/
│   │   └── testUtils.ts
│   ├── unit/
│   │   ├── inputValidation.test.ts
│   │   └── membershipDatabase.test.ts
│   ├── integration/
│   │   ├── api-bottles.test.ts
│   │   ├── api-marketplace.test.ts
│   │   └── api-votes.test.ts
│   ├── security/
│   │   └── security-vulnerabilities.test.ts
│   └── performance/
│       └── load-testing.test.ts
├── e2e/
│   └── membership-flows.spec.ts
├── .github/
│   └── workflows/
│       └── test-automation.yml
├── jest.config.js
├── jest.setup.js
├── playwright.config.ts
├── run-tests.sh
└── TEST_*.md (6 documentation files)
```

---

**Version**: 1.0.0
**Last Updated**: 2024-11-17
**Total Files**: 22 (16 code + 6 docs)
**Status**: Complete