ElectionGuide includes focused automated tests for the most important review categories: assistant correctness, Google service configuration, auth scaffolding, grounding tools, markdown rendering, frontend route breadth, and backend safety behavior.
Run:
cd backend
pip install -r requirements-dev.txt
pytest --cov=. --cov-report=term-missingCurrent backend suite: 48 tests.
Covered areas:
- model and Google configuration behavior,
- Google service registry and health reporting,
- Google Custom Search provider selection,
- official source URL extraction,
- user-facing error messages,
- database model shape,
- Google OAuth provider discovery, demo session persistence, and logout behavior,
- security headers, input limits, and rate limiting,
- civic platform services and route contracts,
- readiness scoring, journeys, quizzes, scenarios, booth guidance, and analytics insights.
Run:
cd frontend
npm testCurrent frontend suite: 12 tests.
Covered areas:
- malformed markdown cleanup from model responses,
- sidebar-safe markdown stripping,
- static accessibility guarantees,
- platform client route coverage,
- landing/platform route coverage,
- Google auth client and sign-in panel coverage.
Run from the repository root:
./scripts/run_quality_checks.shThis executes backend tests when pytest is installed, frontend lint, frontend tests, frontend production build, and Python compile checks.
- Ask a simple election question and confirm one assistant response appears.
- Rapid-click a suggestion and confirm only one conversation/request is created.
- Ask in Hindi with response language set to English and confirm English output.
- Click source citations and confirm they open externally.
- Check
/api/healthfor Google service configuration.