Skip to content

[Feature]: Add Integration Tests for Authentication Endpoints #31

@matthewhou19

Description

@matthewhou19

Problem

The application currently has only a basic context load test. We need comprehensive integration tests for all authentication endpoints to ensure reliability and prevent regressions.

Proposed solution

1. Registration Tests (/auth/register)

  • Valid registration with all required fields
  • Duplicate username handling
  • Duplicate email handling
  • Invalid email format
  • Password validation (minimum requirements)
  • Missing required fields

2. Login Tests (/auth/login)

  • Valid login with email
  • Valid login with username
  • Invalid credentials
  • Non-existent user
  • Missing fields

3. Token Refresh Tests (/auth/refresh/{token})

  • Valid refresh token
  • Expired refresh token
  • Invalid/malformed token
  • Non-existent token

4. Protected Endpoint Tests (/auth/me, /auth/logout)

  • Valid JWT token
  • Missing Authorization header
  • Invalid JWT token
  • Expired JWT token

Acceptance criteria

  • All public endpoints have happy path tests
  • All public endpoints have error case tests
  • All protected endpoints tested with valid JWT
  • All protected endpoints tested without JWT

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions