fix(device-network): seed bootedFixture for runtime suite (#640)#688
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/unit/device-network.test.tsfrom compiling (TS2552), but once it ran the suite produced 9 runtime failures: every test in theoffline path (pfctl wired),reference-counting revert, andstartup reconciliationdescribe blocks was rejected withudid_not_bootedbefore the mocked blocker could be exercised.device-a/device-b/device-c/device-dto the handler, but the globalbeforeEachresetsbootedFixtureto onlybooted-device-id. The handler validates the udid against the booted list and short-circuits.bootedFixtureper describe block with the udids those tests actually use. The negative-path test that expectsghostto be rejected withudid_not_bootedis unaffected —ghostis still intentionally absent from the seeded fixture.Verification
(previously 15 passed / 9 failed on develop HEAD)
Full local
npm run build && npm testis green except for pre-existingax-bridge-helpfailures that depend on a freshly builtdist/(those pass afternpm 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 bootedandGet accuracycheckboxes that the audit expected to land with #679.Test plan
npx jest tests/unit/device-network.test.ts→ 24/24 ✓npm run build→ greennpx jest tests/unit/network-blockers.test.ts→ 44/44 ✓ (untouched)🤖 Generated with Claude Code