Skip to content

test(api validation): check query validation boundaries for ?grace= parameter (Variation 1) #1430

@souravjhahind

Description

@souravjhahind

🧩 Background

Input validation prevents arbitrary code and path traversal sequences from reaching the application core logic.

🎯 Objective

Write a schema-level validation test targeting the ?grace= parameter under positive range check.

📁 Files to touch

  • app/api/streak/route.test.ts
  • lib/validations.test.ts

🛠️ Implementation steps

  • Mock a request passing the invalid value: -1.
  • Assert that the validation handler returns a 400 Bad Request with 'grace must be an integer between 0 and 7'.

✅ Definition of done

  • 1 new test case targeting the query input parameter.
  • All endpoint test suites pass successfully.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions