Uh oh!
There was an error while loading. Please reload this page.
test(app-shell): stub useMetadataClient in metadata-admin inspector suites - #4700
Merged
Merged
Conversation
…uites useObjectFields/useObjectOptions fire a mount-time fetch with no override, which escaped to the real network under happy-dom (ECONNREFUSED noise, different endpoint than #4688's grid explain probe). Stub the shared useMetadataClient in the 9 named inspector test files with a stable client whose get()/list() resolve empty — the same end state the real client's .catch() already produced on a transport error, so no assertion changes. Fixes#4697
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This was referenced Aug 15, 2026
yinlianghui
marked this pull request as ready for review
August 15, 2026 11:27
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Fixes#4697
What
packages/app-shell/src/views/metadata-admin/previews/useObjectFields.tsanduseObjectOptions.tsboth calluseMetadataClient()unconditionally in amount-time
useEffect, which escapes to the real network under happy-dom(
ECONNREFUSED 127.0.0.1:3000— harmless noise, since both hooks alreadydegrade to an empty result on any transport error). Stubs
useMetadataClientin the 9 files the card named, in
packages/app-shell/src/views/metadata-admin/inspectors/:PageBlockInspector.i18n.test.tsxPageBlockInspector.sectionName.test.tsxConditionBuilder.celGate.test.tsxHookDefaultInspector.condition.test.tsxViewVariantInspector.celGate.test.tsxViewVariantInspector.homeGate.test.tsxActionDefaultInspector.celGate.test.tsxConditionBuilder.test.tsxHookDefaultInspector.celGate.test.tsxEach file gets its own
vi.hoisted()+vi.mock('../useMetadata', …)block(mirroring the in-package precedent,
FlowReferenceField.lookup.test.tsx),with a stable stub client (
{ get, list }both resolving to an emptyresult) — stable identity matters because the hooks' effects key off
[client, …], so a fresh object per call would re-fire them every render.No shared helper file: 9 short, self-contained blocks stayed easier to review
than a new cross-file abstraction for this size of change.
Tests-only — no production source touched.
.changeset/metadata-admin-inspector-client-doubles.mddeclares an empty-frontmatter release (test-only, precedent #4641/#4666/#4671).
Acceptance = measured zero
Every file re-run isolated (
pnpm exec vitest run <file> --maxWorkers=1— batched runs undercount, per the card):
PageBlockInspector.i18n.test.tsxPageBlockInspector.sectionName.test.tsxConditionBuilder.celGate.test.tsxHookDefaultInspector.condition.test.tsxViewVariantInspector.celGate.test.tsxViewVariantInspector.homeGate.test.tsxActionDefaultInspector.celGate.test.tsxConditionBuilder.test.tsxHookDefaultInspector.celGate.test.tsxSum 180 → 0, exactly matching the card's baseline. Every assertion unchanged
(same pass counts before/after: 22, 9, 6, 6, 4, 2, 4, 4, 3 — 60 tests total).
Full directory suites also re-run clean:
packages/app-shell/src/views/metadata-admin/inspectors/→ 53 files, 590passed | 1 skipped (pre-existing skip, unrelated), 0 ECONNREFUSED.
packages/app-shell/src/views/metadata-admin/(the whole area) → 167 files,1671 passed | 1 skipped, 0 ECONNREFUSED.
Reverse verification (direction predicted first: reverting the stub
should return the count to baseline with tests still green — proving the stub,
not something else, is what silences the noise): committed the fix, then
git checkout HEAD~1 -- .../PageBlockInspector.i18n.test.tsx(the biggestfile) → re-ran isolated → 70 ECONNREFUSED, 22/22 still passing, confirming
prediction. Restored with
git checkout <fix-sha> -- <path>→ back to 0.Out-of-scope finding
While measuring the full
metadata-admin/suite for step 2 of the verification,found a different escape (
ECONNRESET/"socket hang up", notECONNREFUSED— a different transport mechanism) inpreviews/FlowCanvas.test.tsx(19 lines isolated). Filed unassigned as #4699,not touched here — out of scope for this card.
Local gate union at HEAD
b65801b2dpnpm --filter '@object-ui/app-shell^...' build— dependency closure built first (green).pnpm --filter @object-ui/app-shell run type-check—tsc --noEmit && tsc -p tsconfig.test.json— green.pnpm exec eslint --quiet <the 9 files>— clean, no output.inspectors/and fullmetadata-admin/directory suites (above).node scripts/check-changeset-presence.mjs— green (empty-frontmatter changeset declared).pnpm run check:control-bytes— green.scripts/pm/dispatch-gates.mjsdoes not exist in this repo (checked — itappears to be an
objectstackscript, notobjectui); re-derived theimplicated gate families by hand against the actual diff (9
.test.tsxfilesunder
packages/app-shell/src/views/metadata-admin/inspectors/+ onechangeset) — no new error codes, no
.claude/agents/**changes, no new fakeengine, no
t()call-site changes, no doc changes, so no family beyond theones already named/run above is implicated.
Generated by Claude Code
Generated by Claude Code