Skip to content

Add comprehensive unit tests for API endpoints #20

@Alen983

Description

@Alen983
  • No test files exist. Adding tests ensures reliability and prevents regressions.
  • Relevant part of the codebase: Create backend/tests/ directory with tests for:
  • backend/app/routers/auth.py - login, register
  • backend/app/routers/leave.py - apply, approve, balance calculations
  • backend/app/routers/users.py - role-based access control

Expected outcome:

  • Use pytest and httpx for FastAPI testing
  • Test happy paths, error cases, and edge cases
  • Mock database sessions where appropriate
  • Achieve at least 70% code coverage for critical paths
  • Add pytest to requirements.txt and create pytest.ini

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions