Day2 : bug report, one bug fix, and assign endpoint with tests#17
Open
sanskritig007 wants to merge 5 commits into
Open
Day2 : bug report, one bug fix, and assign endpoint with tests#17sanskritig007 wants to merge 5 commits into
sanskritig007 wants to merge 5 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.mdand documented the issues I found while testing: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/assignwith body:{ "assignee": "string" }It now:
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?
Day 2 Test Cases
page+limit.