Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create POST /api/outfits unit test #73

Open
1 task
rak3rman opened this issue Feb 24, 2024 · 0 comments
Open
1 task

Create POST /api/outfits unit test #73

rak3rman opened this issue Feb 24, 2024 · 0 comments
Labels
backend Related to the hono backend test Related to testing; no production code change

Comments

@rak3rman
Copy link
Member

rak3rman commented Feb 24, 2024

Description

Create a full-fledged unit test for the POST /api/outfits route. This unit test should follow best practice standards for what a unit test is: ensure that all functions called by route are mocked (use the factory objects to your advantage here). This test may end up being quite simple considering that the route is just a wrapper for a drizzle query. Research best standards for writing unit tests. Make sure to test for ALL edge cases.

Acceptance Criteria

Generated by Zenhub AI

  • Scenario: Create POST /api/outfits unit test
  • Given a valid JSON body is provided for the POST request
  • When the POST request is made to /api/outfits
  • Then the response should be a success with the correct status code
  • And the response body should contain the created outfit data
  • Given an invalid JSON body is provided for the POST request
  • When the POST request is made to /api/outfits
  • Then the response should be a failure with the correct status code
  • And the response body should contain an error message
  • Given a missing required parameter in the JSON body
  • When the POST request is made to /api/outfits
  • Then the response should be a failure with the correct status code
  • And the response body should contain an error message
  • Given an invalid value for a required parameter in the JSON body
  • When the POST request is made to /api/outfits
  • Then the response should be a failure with the correct status code
  • And the response body should contain an error message
@rak3rman rak3rman added test Related to testing; no production code change backend Related to the hono backend labels Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to the hono backend test Related to testing; no production code change
Projects
None yet
Development

No branches or pull requests

1 participant