You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add integration tests for HTTP routes and API endpoints #13
The application currently lacks comprehensive integration tests for HTTP routes and API endpoints. This makes it difficult to catch regressions and ensure that the entire request/response cycle works correctly.
Proposed Solution
Implement integration tests that cover all major HTTP routes and API endpoints, testing the full stack from HTTP request to database queries to response rendering.
Implementation Tasks
Set up integration test framework and utilities
Test Species Explorer search endpoint with various parameters
Test sorting functionality with different sort fields
Test error handling for invalid inputs
Test pagination when implemented
Test response formats (HTML vs JSON if applicable)
Add tests for edge cases (empty results, special characters, etc.)
Set up CI to run integration tests
Reference
This issue was identified in PR #9 review comments as part of the Species Explorer feature development.
Impact
Integration tests will provide confidence in deployments and help catch issues that unit tests might miss.
The foundation for comprehensive integration testing has been significantly strengthened by recent database testing infrastructure improvements (commit 0931a4a).
✅ Current Integration Test Infrastructure
Database Integration Tests:
src/__tests__/members.ts - Comprehensive member and roster testing with real database operations
src/__tests__/species.ts - Species explorer and data management testing
Robust testDbHelper.helper.ts with utilities for creating test data and managing database lifecycle
Test Quality Improvements:
In-memory SQLite databases for fast, isolated testing
Proper foreign key constraint enforcement
Utilities for creating realistic test data (createTestMembers, createTestSpeciesName)
Suite-level database fixtures with automatic setup/teardown
All 92 tests passing consistently
🎯 HTTP Route Testing Assessment
Current State:
The existing database integration tests provide excellent coverage of the data layer that underlies all HTTP routes. The infrastructure is now solid enough that adding HTTP-level integration tests would be straightforward.
Options for HTTP Route Testing:
Extend existing test infrastructure - The testDbHelper could easily be used with supertest or similar HTTP testing tools
Focus on critical user journeys - Member registration, submission creation, admin approval workflows
API endpoint validation - Ensure all routes return expected status codes and data formats
🤔 Recommendation
Option A: Close this issue since we now have robust integration testing of the core business logic and data layer.
Option B: Update this issue to be more specific about HTTP-level testing requirements and user journey validation.
The database integration tests we now have provide significantly more value than typical HTTP route tests, as they validate the actual business logic and data integrity. HTTP route tests would primarily validate request/response handling rather than core functionality.
What do you think? Should we focus on other priorities, or are there specific HTTP routes/user journeys that would benefit from dedicated integration tests?
Build a robust E2E and integration testing suite that runs in GitHub Actions, testing actual web flows with HTTP requests, database interactions, and full request/response cycles.
📋 Implementation Plan
Phase 1: E2E Test Infrastructure (Foundation)
Create E2E test utilities (src/__tests__/e2eHelper.ts)
Test app factory that creates Express app instance with all routes
Supertest integration for HTTP testing
Test database setup using existing setupTestDatabase()<
8000
/li>
Session/auth helpers for authenticated requests
Cookie jar management for multi-request flows
Create test config (src/config.test.json)
Test-specific configuration (no real OAuth, SMTP, R2 credentials needed)
Mock/stub external services (email, R2 storage)
Phase 2: Critical User Journey Tests (High-Value E2E)
This plan leverages the existing robust database testing infrastructure and extends it to cover full HTTP request/response cycles, user journeys, and real-world workflows.
Activity
jra3 commentedon Jun 26, 2025
The foundation for comprehensive integration testing has been significantly strengthened by recent database testing infrastructure improvements (commit
0931a4a).✅ Current Integration Test Infrastructure
Database Integration Tests:
src/__tests__/members.ts- Comprehensive member and roster testing with real database operationssrc/__tests__/species.ts- Species explorer and data management testingtestDbHelper.helper.tswith utilities for creating test data and managing database lifecycleTest Quality Improvements:
createTestMembers,createTestSpeciesName)🎯 HTTP Route Testing Assessment
Current State:
The existing database integration tests provide excellent coverage of the data layer that underlies all HTTP routes. The infrastructure is now solid enough that adding HTTP-level integration tests would be straightforward.
Options for HTTP Route Testing:
testDbHelpercould easily be used with supertest or similar HTTP testing tools🤔 Recommendation
Option A: Close this issue since we now have robust integration testing of the core business logic and data layer.
Option B: Update this issue to be more specific about HTTP-level testing requirements and user journey validation.
The database integration tests we now have provide significantly more value than typical HTTP route tests, as they validate the actual business logic and data integrity. HTTP route tests would primarily validate request/response handling rather than core functionality.
What do you think? Should we focus on other priorities, or are there specific HTTP routes/user journeys that would benefit from dedicated integration tests?
jra3 commentedon Oct 8, 2025
Comprehensive E2E & Integration Testing Plan
🎯 Overview
Build a robust E2E and integration testing suite that runs in GitHub Actions, testing actual web flows with HTTP requests, database interactions, and full request/response cycles.
📋 Implementation Plan
Phase 1: E2E Test Infrastructure (Foundation)
Create E2E test utilities (
src/__tests__/e2eHelper.ts)setupTestDatabase()< 8000 /li>Create test config (
src/config.test.json)Phase 2: Critical User Journey Tests (High-Value E2E)
Authentication flows (
src/__tests__/e2e/auth.test.ts)Submission creation flow (
src/__tests__/e2e/submission-flow.test.ts)Admin approval workflow (
src/__tests__/e2e/admin-workflow.test.ts)Member progression (
src/__tests__/e2e/member-progression.test.ts)Phase 3: HTTP Route Integration Tests (API Coverage)
Public routes (
src/__tests__/integration/public-routes.test.ts)Auth routes (
src/__tests__/integration/auth-routes.test.ts)Submission routes (
src/__tests__/integration/submission-routes.test.ts)Admin routes (
src/__tests__/integration/admin-routes.test.ts)API endpoints (
src/__tests__/integration/api-routes.test.ts)Phase 4: GitHub Actions Workflow (CI/CD)
Enhanced CI workflow (
.github/workflows/ci.yml)Docker test environment (optional,
docker-compose.test.yml)Phase 5: Test Quality & Maintenance
Test documentation (update
CLAUDE.md)Coverage targets
🔧 Technical Details
Existing Foundation:
supertestalready installedtestDbHelperprovides database fixturesNew Dependencies:
Key Testing Patterns:
Mocking Strategy:
📊 Success Metrics
🚀 Rollout Strategy
Estimated effort: 2-3 days of focused work
This plan leverages the existing robust database testing infrastructure and extends it to cover full HTTP request/response cycles, user journeys, and real-world workflows.
jra3 commentedon Oct 23, 2025
Significant Progress on Integration Testing
While full HTTP route testing isn't yet complete, we've made major progress on integration testing for the admin approval workflow:
New Integration Tests Added (66 tests)
Witness Operations (
witness-operations.test.ts) - 20 testsRequest Changes Workflow (
request-changes.test.ts) - 22 testsEdit Approved Submissions (
edit-approved-submission.test.ts) - 24 testsTest Coverage Summary
Remaining Work
Still need HTTP route-level integration tests for:
Keeping this issue open to track the remaining HTTP route testing work.
jra3 commentedon Oct 13, 2026
The October maintainability review produced bounded implementation proposals for the remaining testability foundations:
These complement the existing handler/render and database tests; they do not claim that the full route coverage described in this issue is complete.