test(pms-11): cover assign + assert JOINed ticket DTO fields (F3) #73

Merged
longjacksonle merged 1 commit from feat/pms-11-tickets-assign-joined-fields-test into main 2026-06-05 03:30:52 +02:00

What

Closes the last open acceptance criterion on PMS-11 (Story: Tickets API): the integration test that pins the F3 fix. The five implementation criteria (F3 fully-populated DTOs, on_create / on_update automation, add_note send_email, F9 filter validation) were already delivered by subtasks PMS-12 through PMS-16 and are live on main. The story's test criterion was the only gap: the existing ticket_lifecycle_happy_path stopped at add-note and asserted only title, so a regression of F3 (handlers returning 200 with blank JOINed name/color fields) would have sailed through green.

Changes

tests/tickets.rs:

  • Extends the happy path to the full acceptance-criterion flow: create -> list -> get -> update -> assign -> add note (assign was previously untested).
  • Adds assert_joined_fields_populated, run against every returned DTO (create, list item, get, update, assign). It fails if status.name, status.color, priority.name, priority.color, queue_name, company_name, or created_by_name come back empty - the exact fields F3 used to blank out.
  • The assign step posts the seeded admin as assignee and asserts the re-fetched DTO echoes assigned_to_id and resolves assigned_to_name through the users JOIN.

Verification

cargo test --test tickets ticket_lifecycle_happy_path passes against the dev Postgres; cargo clippy --test tickets -- -D warnings and cargo fmt --check are clean. No production code changed - this is test-only coverage hardening.

🤖 Generated with Claude Code

## What Closes the last open acceptance criterion on [PMS-11 (Story: Tickets API)](https://niceguyit.myjetbrains.com/youtrack/issue/PMS-11): the integration test that pins the F3 fix. The five implementation criteria (F3 fully-populated DTOs, on_create / on_update automation, add_note send_email, F9 filter validation) were already delivered by subtasks PMS-12 through PMS-16 and are live on main. The story's test criterion was the only gap: the existing `ticket_lifecycle_happy_path` stopped at add-note and asserted only `title`, so a regression of F3 (handlers returning `200` with blank JOINed name/color fields) would have sailed through green. ## Changes `tests/tickets.rs`: - Extends the happy path to the full acceptance-criterion flow: create -> list -> get -> update -> **assign** -> add note (assign was previously untested). - Adds `assert_joined_fields_populated`, run against every returned DTO (create, list item, get, update, assign). It fails if `status.name`, `status.color`, `priority.name`, `priority.color`, `queue_name`, `company_name`, or `created_by_name` come back empty - the exact fields F3 used to blank out. - The assign step posts the seeded admin as assignee and asserts the re-fetched DTO echoes `assigned_to_id` and resolves `assigned_to_name` through the users JOIN. ## Verification `cargo test --test tickets ticket_lifecycle_happy_path` passes against the dev Postgres; `cargo clippy --test tickets -- -D warnings` and `cargo fmt --check` are clean. No production code changed - this is test-only coverage hardening. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
test(pms-11): cover assign + assert JOINed ticket DTO fields (F3)
Some checks failed
Check / fmt + clippy + compile + tests (pull_request) Failing after 49s
Create release / Create release from merged PR (pull_request) Has been skipped
ef5af8008c
The ticket lifecycle integration test stopped at add-note and asserted only the title, so it never pinned the headline PMS-11 defect F3: ticket handlers used to return 200 with empty-string name/color fields. This extends the happy path to create -> list -> get -> update -> assign -> add note, and runs every returned DTO (create, list item, get, update, assign) through `assert_joined_fields_populated`, which fails if status.name/color, priority.name/color, queue_name, company_name, or created_by_name come back blank.

The new assign step posts the seeded admin as assignee and asserts the re-fetched DTO echoes assigned_to_id and resolves assigned_to_name via the users JOIN that F3 left empty, closing the last open PMS-11 acceptance criterion (the other four were delivered by subtasks PMS-12..PMS-16).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle deleted branch feat/pms-11-tickets-assign-joined-fields-test 2026-06-05 03:30:52 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-server!73
No description provided.