Skip to content

test: add MaintenanceRequestsController integration tests (Story 21.1)#372

Merged
daveharmswebdev merged 1 commit intomainfrom
story/21-1-maintenance-requests-controller-integration-tests
Apr 19, 2026
Merged

test: add MaintenanceRequestsController integration tests (Story 21.1)#372
daveharmswebdev merged 1 commit intomainfrom
story/21-1-maintenance-requests-controller-integration-tests

Conversation

@daveharmswebdev
Copy link
Copy Markdown
Owner

Summary

  • Backfills 27 WebApplicationFactory-based integration tests covering all 4 endpoints of MaintenanceRequestsController (Epic 21, Story 21.1 — closes test-coverage gap identified in issue Testing pyramid gaps: integration + E2E coverage for newer features #371)
  • Extends PropertyManagerWebApplicationFactory additively with CreateTenantUserInAccountAsync and CreatePropertyInAccountAsync — existing helpers unchanged (verified against 558 pre-existing Api.Tests)
  • Zero production code changes — ACs were reconciled against the shipped controller contract and every delta is documented in the story's Dev Notes

Coverage

  • POST /maintenance-requests (create, validation, tenant→property linkage via JWT claim)
  • GET /maintenance-requests (admin account-scoped, tenant property-scoped, status filter, pagination)
  • GET /maintenance-requests/{id} (access control — returns 404, not 403, to avoid existence disclosure)
  • GET /tenant/property/maintenance-requests (tenant property-scoped list)

Test plan

  • dotnet test — 1845/1845 passing (558 Api + 1189 Application + 98 Infrastructure)
  • npm test — 2751/2751 frontend unit tests passing
  • npx playwright test — 212/213 (1 pre-existing Reports-flow flake, unrelated)
  • Backend + frontend builds clean (0 warnings, 0 errors)
  • Adversarial review: tests assert meaningful behavior (404 specificity, CreatedAt ordering, soft-delete filter, tenant isolation)

🤖 Generated with Claude Code

Backfill 27 WebApplicationFactory integration tests covering all 4
endpoints of MaintenanceRequestsController. Extends the test factory
with additive helpers (CreateTenantUserInAccountAsync,
CreatePropertyInAccountAsync) without changing existing signatures.

ACs were reconciled against shipped controller behavior — deltas from
the original epic are documented in story Dev Notes. No production code
changed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@daveharmswebdev daveharmswebdev merged commit a3fcd2a into main Apr 19, 2026
7 checks passed
@daveharmswebdev daveharmswebdev deleted the story/21-1-maintenance-requests-controller-integration-tests branch April 19, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant