Repository navigation
test(ui): remove Lit fixtures from Solid component tests - #169387
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR replaces Lit fixture rendering and types with DOM operations and existing Solid helpers in component tests. Example: An MCP view replacement waits for pending teardown.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it completes useful, maintainer-directed Solid test migration while preserving the existing assertions, and no actionable patch defect was found. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherControl UI component tests supply synthetic properties and lifecycle events to registered components and shared owners, then inspect rendered DOM and cleanup outcomes. flowchart LR
A[Test inputs] --> B[DOM and Solid fixtures]
B --> C[Registered component bridges]
B --> D[MCP unmount gate]
C --> E[Rendered DOM]
D --> E
E --> F[Existing assertions]
Technical reviewBest possible solution: Land the focused fixture conversion through the existing maintainer workflow and its inherited-failure route. Do we have a high-confidence way to reproduce the issue? This PR addresses obsolete test fixtures rather than a product defect; the introduced diff confirms the Lit dependencies, and no target code or tests were executed during this read-only review. Is this the best way to solve the issue? The conversion uses existing mounting and cleanup owners, preserves the tested contracts, and retains production Lit adapters for their remaining callers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 042db1e70649. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +25. Total +25 across 10 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 11, 2026, 6:17 PM ET / 22:17 UTC (Revision 2). |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
## What Problem This Solves Fixes `check-test-types-core-2` failures inherited by PRs after the MCP App tests switched from Lit to Solid. ## User Impact No user-visible change. This restores typechecking for the existing MCP App lifecycle and context-update regressions without weakening their assertions. ## Why This Change Was Made The fixture migration in #169387 left a raw Solid memo accessor as a component return value and awaited Lit's `updateComplete` on a plain Solid-rendered context-strip element. Render the memo through a JSX fragment in a `.test.tsx` fixture, and wait for the context strip's observable item/empty state with the existing `waitForSolid` helper. All teardown, retained-node, and context assertions remain intact. Checked existing work first: #169247 does not change these tests and its `check-test-types-core-2` job is red; #169304 changes different parts of the MCP App tests and does not repair these errors. ## Evidence Baseline: current `origin/main` at `5889e62f4902b8f3fa4b6eb2cecbbd26f5b8ceb0`, installed with `pnpm install --frozen-lockfile`. Before, `pnpm run tsgo:test:ui` exited 2: ```text ui/src/components/mcp-app-unmount.test.ts(40,5): error TS2345: Argument of type '() => SourceAccessor<Node[]>' is not assignable to parameter of type '() => Element'. ui/src/components/mcp-app-view.test.ts(801,19): error TS2339: Property 'updateComplete' does not exist on type 'Element'. ui/src/components/mcp-app-view.test.ts(804,19): error TS2339: Property 'updateComplete' does not exist on type 'Element'. ui/src/components/mcp-app-view.test.ts(815,19): error TS2339: Property 'updateComplete' does not exist on type 'Element'. [tsgo:ui-components] failed (exit 2) ``` After: - `pnpm run tsgo:test:ui`: all eight graphs passed, including `ui-components`. - `node scripts/run-vitest.mjs ui/src/components/mcp-app-unmount.test.tsx ui/src/components/mcp-app-view.test.ts --maxWorkers=1`: 31 tests passed across the regular and isolated UI projects. Test time: 71 ms for unmount and approximately 5.9 s for view (4.6 s is the existing embedded Apps page scenario). - Changed-file `oxfmt --write` and `oxlint`: passed. - `node --import ./scripts/tsx.mjs scripts/check-line-cap-ratchet.mts --base origin/main`: passed, no new violations or over-cap growth. The existing embedded Apps page scenario emits Lit/reactivity and jsdom CSS warnings; it passes without suppressions or retry changes. - Independent autoreview: scoped clean through P2; no actionable findings. Co-authored-by: Ayaan Zaidi <[email protected]>
## What Problem This Solves Fixes `check-test-types-core-2` failures inherited by PRs after the MCP App tests switched from Lit to Solid. ## User Impact No user-visible change. This restores typechecking for the existing MCP App lifecycle and context-update regressions without weakening their assertions. ## Why This Change Was Made The fixture migration in openclaw#169387 left a raw Solid memo accessor as a component return value and awaited Lit's `updateComplete` on a plain Solid-rendered context-strip element. Render the memo through a JSX fragment in a `.test.tsx` fixture, and wait for the context strip's observable item/empty state with the existing `waitForSolid` helper. All teardown, retained-node, and context assertions remain intact. Checked existing work first: openclaw#169247 does not change these tests and its `check-test-types-core-2` job is red; openclaw#169304 changes different parts of the MCP App tests and does not repair these errors. ## Evidence Baseline: current `origin/main` at `11f576b23cf70615ca4504eb12fdba93591b9c8f`, installed with `pnpm install --frozen-lockfile`. Before, `pnpm run tsgo:test:ui` exited 2: ```text ui/src/components/mcp-app-unmount.test.ts(40,5): error TS2345: Argument of type '() => SourceAccessor<Node[]>' is not assignable to parameter of type '() => Element'. ui/src/components/mcp-app-view.test.ts(801,19): error TS2339: Property 'updateComplete' does not exist on type 'Element'. ui/src/components/mcp-app-view.test.ts(804,19): error TS2339: Property 'updateComplete' does not exist on type 'Element'. ui/src/components/mcp-app-view.test.ts(815,19): error TS2339: Property 'updateComplete' does not exist on type 'Element'. [tsgo:ui-components] failed (exit 2) ``` After: - `pnpm run tsgo:test:ui`: all eight graphs passed, including `ui-components`. - `node scripts/run-vitest.mjs ui/src/components/mcp-app-unmount.test.tsx ui/src/components/mcp-app-view.test.ts --maxWorkers=1`: 31 tests passed across the regular and isolated UI projects. Test time: 71 ms for unmount and approximately 5.9 s for view (4.6 s is the existing embedded Apps page scenario). - Changed-file `oxfmt --write` and `oxlint`: passed. - `node --import ./scripts/tsx.mjs scripts/check-line-cap-ratchet.mts --base origin/main`: passed, no new violations or over-cap growth. The existing embedded Apps page scenario emits Lit/reactivity and jsdom CSS warnings; it passes without suppressions or retry changes. - Independent autoreview: scoped clean through P2; no actionable findings. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Tests for already-Solid components still imported Lit to mount fixtures, dispose containers, or describe element types, keeping the test migration unfinished.
User Impact
No user-visible change. Ten component test files drop their direct Lit dependency while retaining all 566 assertions.
Why This Change Was Made
Use plain DOM creation/property assignment for bridged elements and inert SVG snapshots, and the existing Solid mount/disposal helpers for owned roots. The MCP unmount tests now exercise a Solid-owned subtree and retain their node-identity, teardown, rebound, and sibling assertions.
Only tests change. No production components, styles, routes, lazy boundaries, dependencies, or shared test helpers change. The two Lit unmount fixture classes become a shared Solid fixture, accounting for the small LOC increase: 4,195 → 4,220 test lines (+25).
Ten converted files remove 11 Lit import statements → 0. Across
ui/src/components,ui/src/lib, andui/src/test-helpers, importing test/helper files fall 85 → 75 (all UI: 376 → 366).Evidence
pnpm test <files> --maxWorkers=1pnpm tsgo:uigit diff --checkpnpm ui:buildProof uses Blacksmith Testbox
tbx_01m4pdyfdf3cz0qae5eysm2ng6(runner). The tested source tree matches the committed tree. No visual production change, so screenshots are not applicable. PR CI ran on mergee206b84over main84a834e: E2E failed before tests with three unresolved imports ofdomain-board.ts/domain-keyed.ts. Those adapters were removed on main in #169368 while these importers remain. The exact baseline reproduces all three errors (bundle failure in 3.27 s); the PR changes none of these inputs. CI cancelled 14 sibling jobs via its successful fail-fast monitor, so those jobs are unproven, not green. Landing uses the native inherited-failure route with exact checkout, source, log, cancellation, and live-gate evidence.Left in place: tests that still exercise Lit renderers, including copy-button, row badges, provider usage, panel presentation helpers, agent-scope control, decision picker, and the presentation-primitives fixture. Also left mixed-entry tests for viewer-facepile (Lit chat author avatar), link-reader page preview (Lit sign-in controls), MCP bridge/message (Lit confirmation/attachments), plus files owned by other migration lanes. No assertions were removed to make an import disappear.