Skip to content

Day2 : bug report, one bug fix, and assign endpoint with tests#17

Open
sanskritig007 wants to merge 5 commits into
rohit-ups:mainfrom
sanskritig007:day2-clean
Open

Day2 : bug report, one bug fix, and assign endpoint with tests#17
sanskritig007 wants to merge 5 commits into
rohit-ups:mainfrom
sanskritig007:day2-clean

Conversation

@sanskritig007
Copy link
Copy Markdown

@sanskritig007 sanskritig007 commented Apr 3, 2026

Day 2 Work

For Day 2, I completed all three parts of the assignment.
Live API: https://take-home-assignment-the-untested-api-um1b.onrender.com

Part A: Bug report

I added task-api/BUG_REPORT.md and documented the issues I found while testing:

  • expected vs actual behavior
  • how I found each issue
  • what fix should be done

Part B: Fix one bug

I fixed task completion so the original priority is not overwritten when a task is marked complete.

Part C: New endpoint

I added PATCH /tasks/:id/assign with body:
{ "assignee": "string" }

It now:

  • saves assignee on the task
  • returns updated task
  • returns 404 if task ID does not exist
  • returns 400 for invalid assignee input (empty/missing/non-string)

Tests

I updated both unit and integration tests for these changes.
All tests are passing locally, and I also ran coverage before submission.

Short note

If I had more time, I would’ve added a few more tests around pagination input (like invalid/negative values) and assignment behavior when a task is already assigned.
One thing that genuinely stood out while working on this was how easy it is to miss logic issues in small helper functions unless tests are in place. Writing tests made the weak spots obvious much faster than manual checks.
Before pushing this to production, I’d want to confirm:
-Should reassignment overwrite existing assignee or return an error?
-How strict should query/body validation be across endpoints?
-Do we want to continue with in-memory storage, or move to a persistent DB setup first?

image image

Day 2 Test Cases

  • Pagination returns correct item count for page + limit.
  • Validation rejects invalid payloads with proper error response.
  • New endpoint success path works as expected.
  • Edge-case behavior is covered for invalid/missing inputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant