Skip to content

Add test coverage for work item states API endpoints #180

@BenGWeeks

Description

@BenGWeeks

Summary

Add unit tests for the new Azure DevOps work item states API endpoints introduced in PR #169.

Related PR

Endpoints to test

  1. GET /api/devops/workitem-states - Fetches available work item states from Azure DevOps
  2. PATCH /api/devops/tickets/[id]/state - Updates a ticket's state

Suggested test scenarios

workitem-states endpoint

  • Returns states for configured work item types
  • Handles missing/unauthorized Azure DevOps access gracefully
  • Caches state responses appropriately

state update endpoint

  • Successfully updates ticket state
  • Handles invalid state transitions
  • Returns appropriate error for non-existent tickets
  • Validates authorization

Notes

This was identified during code review on PR #169 and deferred to keep the PR focused.

Metadata

Metadata

Assignees

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