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

test/202-create-unit-tests-for-delete-comments-by-user-id #202

Open
8 tasks
Tracked by #153
benoit-bremaud opened this issue Jul 20, 2024 · 0 comments
Open
8 tasks
Tracked by #153

test/202-create-unit-tests-for-delete-comments-by-user-id #202

benoit-bremaud opened this issue Jul 20, 2024 · 0 comments
Assignees
Labels
backend Label to indicate the backend team test Related to testing and validation unit-test Unit tests

Comments

@benoit-bremaud
Copy link
Owner

benoit-bremaud commented Jul 20, 2024

Description:

Summary

Create unit tests to ensure the functionality and robustness of the DELETE /comments/user/:userId route. These tests will verify that the route correctly deletes all comments by a specific user ID and handles various edge cases, including authorization checks.

Context

Unit tests are essential to verify that the DELETE /comments/user/:userId route works as intended. This route allows authenticated users to delete all comments by a specific user ID, ensuring only the author or an admin can perform the deletion. Tests will help ensure the route handles different scenarios correctly, such as missing comments, unauthorized access, and successful deletion.

Objectives

  • Implement unit tests for the DELETE /comments/user/:userId route.
  • Ensure tests cover all edge cases, including authorization checks and missing comments.
  • Verify the route only allows deletion by the author or an admin.
  • Confirm the route returns appropriate responses (e.g., 404 Not Found, 403 Forbidden).

Acceptance Criteria

  • Unit tests must cover successful deletion of all comments by a user ID.
  • Tests must verify the route returns 404 if no comments are found for the user.
  • Tests must check that only the author or an admin can delete the comments (403 Forbidden for unauthorized users).
  • All tests must pass without errors.

Tasks

  • Create and initialize a new working branch
    • Branch name format: test/202-create-unit-tests-for-delete-comments-by-user-id
  • Implement unit tests for the DELETE /comments/user/:userId route.
  • Verify the tests cover all edge cases.
  • Ensure tests pass successfully.
  • Write the commit message
    • Ensure the commit message follows the naming conventions as specified in the CONTRIBUTING.md guide.
  • Create the Pull Request
    • Ensure the Pull Request follows the naming and description conventions as specified in the CONTRIBUTING.md guide.

Resources

UML Diagrams References

  • Sequence Diagram: To visualize the flow of operations during the DELETE /comments/user/:userId request.

Branch Name

test/202-create-unit-tests-for-delete-comments-by-user-id

Complementary Suggested Tasks

  • Ensure compatibility with existing features and perform regression testing.
  • Review and update related configuration settings if required.
@benoit-bremaud benoit-bremaud added backend Label to indicate the backend team test Related to testing and validation unit-test Unit tests labels Jul 20, 2024
@benoit-bremaud benoit-bremaud changed the title Mettre à jour les tests unitaires pour inclure des cas de test pour cette nouvelle route. test/202-create-unit-tests-for-delete-comments-by-user-id Jul 20, 2024
@benoit-bremaud benoit-bremaud self-assigned this Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Label to indicate the backend team test Related to testing and validation unit-test Unit tests
Projects
None yet
Development

No branches or pull requests

1 participant