fix(test): resolve petsExtendedFields vi.mock hoisting + invalid UUIDs (GRO-1390) #32

Merged
Lint Roller merged 1 commits from fix/gro-1390-pets-test-mock-hoisting into dev 2026-05-21 07:02:59 +00:00
Member

Summary

  • Fix petsExtendedFields.test.ts vi.mock hoisting error: replace bare and/eq/exists/or variable references with inline mock functions
  • Fix invalid UUID test fixtures (CLIENT_ID/PET_ID) that fail z.string().uuid() validation

Test plan

  • petsExtendedFields.test.ts — 16/16 pass (was 0/16 — file failed to load)
  • Full suite: 36/36 files, 521/521 tests pass
## Summary - Fix `petsExtendedFields.test.ts` vi.mock hoisting error: replace bare `and`/`eq`/`exists`/`or` variable references with inline mock functions - Fix invalid UUID test fixtures (`CLIENT_ID`/`PET_ID`) that fail `z.string().uuid()` validation ## Test plan - [x] `petsExtendedFields.test.ts` — 16/16 pass (was 0/16 — file failed to load) - [x] Full suite: 36/36 files, 521/521 tests pass
The Dogfather added 1 commit 2026-05-21 05:28:53 +00:00
fix(test): fix petsExtendedFields vi.mock hoisting and invalid UUIDs
CI / Lint & Typecheck (pull_request) Successful in 16s
CI / Test (pull_request) Successful in 21s
CI / Build & Push Docker Image (pull_request) Successful in 27s
c1d28635ba
Two pre-existing bugs prevented petsExtendedFields.test.ts from running:

1. vi.mock factory referenced bare `and`, `eq`, `exists`, `or` variables
   that are undefined at hoist time — replaced with inline mock functions
2. CLIENT_ID/PET_ID used non-UUID strings but Zod schema requires uuid()

All 36 test files (521 tests) now pass.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
Lint Roller approved these changes 2026-05-21 05:31:04 +00:00
Lint Roller left a comment
Member

QA review passed.

  • Test-only change (1 file, 6 insertions, 6 deletions)
  • vi.mock hoisting fix: inline mock functions replace bare variable references that were undefined at hoist time
  • UUID fix: CLIENT_ID and PET_ID now use proper UUID format to satisfy z.string().uuid() validation
  • CI: Lint, typecheck, and tests all pass (521/521 tests across 36 files)
  • No user-facing behaviour changes — UAT_PLAYBOOK.md update not required
QA review passed. - Test-only change (1 file, 6 insertions, 6 deletions) - vi.mock hoisting fix: inline mock functions replace bare variable references that were undefined at hoist time - UUID fix: CLIENT_ID and PET_ID now use proper UUID format to satisfy z.string().uuid() validation - CI: Lint, typecheck, and tests all pass (521/521 tests across 36 files) - No user-facing behaviour changes — UAT_PLAYBOOK.md update not required
Lint Roller merged commit fdd9d62ee9 into dev 2026-05-21 07:02:59 +00:00
Sign in to join this conversation.