Skip to content

fix(device-network): seed bootedFixture for runtime suite (#640)#688

Merged
shaun0927 merged 1 commit into
developfrom
fix/640-test-fixture-booted-udids
Apr 27, 2026
Merged

fix(device-network): seed bootedFixture for runtime suite (#640)#688
shaun0927 merged 1 commit into
developfrom
fix/640-test-fixture-booted-udids

Conversation

@shaun0927
Copy link
Copy Markdown
Owner

Summary

  • PR fix(device-network): unblock device-network test suite (#640) #679 unblocked tests/unit/device-network.test.ts from compiling (TS2552), but once it ran the suite produced 9 runtime failures: every test in the offline path (pfctl wired), reference-counting revert, and startup reconciliation describe blocks was rejected with udid_not_booted before the mocked blocker could be exercised.
  • Root cause: those describe blocks pass udids device-a / device-b / device-c / device-d to the handler, but the global beforeEach resets bootedFixture to only booted-device-id. The handler validates the udid against the booted list and short-circuits.
  • Fix: seed bootedFixture per describe block with the udids those tests actually use. The negative-path test that expects ghost to be rejected with udid_not_booted is unaffected — ghost is still intentionally absent from the seeded fixture.
  • No production code changed.

Verification

$ npx jest tests/unit/device-network.test.ts
Test Suites: 1 passed, 1 total
Tests:       24 passed, 24 total

(previously 15 passed / 9 failed on develop HEAD)

Full local npm run build && npm test is green except for pre-existing ax-bridge-help failures that depend on a freshly built dist/ (those pass after npm run build, unrelated to this change).

Issue alignment

Closes the last live test gap on #640's device_network_get rejects explicit udid that is not booted and Get accuracy checkboxes that the audit expected to land with #679.

Test plan

  • npx jest tests/unit/device-network.test.ts → 24/24 ✓
  • npm run build → green
  • npx jest tests/unit/network-blockers.test.ts → 44/44 ✓ (untouched)

🤖 Generated with Claude Code

PR #679 fixed the TS2552 compile error blocking `device-network.test.ts`
from running, but once the suite executed it produced 9 runtime failures
because the `offline path (pfctl wired)`, `reference-counting revert`,
and `startup reconciliation` describe blocks pass udids `device-a`/`-b`/
`-c`/`-d` while the global `beforeEach` resets `bootedFixture` to only
`booted-device-id`. The handler's `udid_not_booted` validation rejected
every call before the mocked blocker could be exercised.

Seed `bootedFixture` per describe block with the udids those tests
actually use. The `device_network_get rejects explicit udid that is not
booted` test still expects `ghost` to be rejected — `ghost` is
intentionally absent from the seeded fixture, so its negative-path
assertion is unaffected.

Result: `device-network.test.ts` now passes 24/24 locally
(previously 15/24). No production code changed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@shaun0927 shaun0927 merged commit 6052513 into develop Apr 27, 2026
3 checks passed
@shaun0927 shaun0927 deleted the fix/640-test-fixture-booted-udids branch April 27, 2026 08:14
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