Skip to content

🚀 Feature: Add new test coverage for auth route validation and security edge cases #512

@JayRathore10

Description

@JayRathore10

🔖 Feature description

Description

The current authentication test suite covers the basic authentication flow:

  • User signup
  • Duplicate email check
  • Duplicate username check
  • Successful login
  • Failed login (wrong password)
  • Logout

However, several validation and security-related scenarios are not currently tested.

Proposed Test Cases

Signup

  • Reject signup when email is missing
  • Reject signup when username is missing
  • Reject signup when password is missing
  • Reject empty request body

Login

  • Reject login for non-existent users
  • Reject login when email is missing
  • Reject login when password is missing

Security

  • Verify passwords are stored hashed in the database
  • Verify login responses do not expose password hashes

Session Handling

  • Verify logout behavior when no active session exists

Benefits

  • Improves test coverage for edge cases
  • Prevents regressions in validation logic
  • Adds security-focused assertions
  • Ensures sensitive data is not leaked through API responses

Expected Outcome

A more robust authentication test suite with better validation, security, and error-handling coverage.

🎤 Screenshot

No response

🔄️ Additional Information

No response

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions