Skip to content

Fix: Add missing inetegration tests task update API PATCH /v1/tasks/{taskId} #88

@Achintya-Chatterjee

Description

@Achintya-Chatterjee

Issue Description

The current integration test suite for the task update API (PATCH /v1/tasks/{taskId}) is not comprehensive. We need to add more test cases to cover various scenarios and ensure the endpoint is robust and reliable. This will help prevent regressions and bugs in the future.

Missing Test Cases

The following integration test cases are missing for the update task endpoint:

Payload Validation:

  • Test with an empty payload (should return 400 Bad Request).
  • Test with invalid values for priority (e.g., ULTRA_HIGH) and status (e.g., ARCHIVED).
  • Test updating dueAt with a valid datetime string.
  • Test updating dueAt with an invalid datetime format.
  • Test sending fields that are not allowed to be updated (e.g., createdAt).

Partial Updates:

  • Test updating only the title.
  • Test updating only the status.
  • Test updating only the labels.

Authentication:

  • Test making a request without authentication tokens (should return 401 Unauthorized).

Field Specific:

  • Test updating the assignee.
  • Test adding new labels to a task.
  • Test removing labels from a task.
  • Test replacing all labels of a task.

Acceptance Criteria

  • All the missing test cases listed above are implemented in todo/tests/integration/test_task_update_api.py.
  • The new tests should be well-structured and follow the existing patterns in the test suite.
  • All tests, including the new ones, pass successfully.

Additional Information

This ticket was created based on the suggestion from @AnujChhikara to improve the test coverage for the task update functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions