Skip to content

test: prune UI tests that can't catch a bug, fix two that couldn't fail - #1957

Merged
Makisuo merged 2 commits into
mainfrom
chore/prune-ui-tests
Oct 30, 2026
Merged

Makisuo merged 2 commits into
mainfrom
chore/prune-ui-tests

Conversation

@Makisuo

@Makisuo Makisuo commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

From an audit of the UI test suites (apps/web, apps/local-ui, packages/ui). The suites are mostly solid, so this only removes tests that duplicate coverage or pin config, and fixes two assertions that could never fail.

Removed

  • apps/web/src/lab/{service-map-3d-lab,timeline-lab,gcp-filter-lab} tests: dev-only lab pages; each test only re-checks message forwarding into a component whose own tests already cover it. The other lab tests stay, since they check lab-specific behaviour (no API reads leak, pivot sync, stale reload spins).
  • apps/local-ui log sheet "opens its tooltip": re-ran the shared Tooltip open sequence, covered by apps/web/src/ui/tooltip.scene.test.ts.
  • service-map-elk.test.ts: option-string pins (aspect ratio, thoroughness, ordering strategies) that break on deliberate layout tuning. The flat vs namespaced graph and >300 node strategy switch checks stay.

Fixed

  • legend-slot-hoisting.browser.test.tsx "answers during the first render": asserted String(boolean) was non-empty, which is always true. It now records the hook's first-render answer and expects true.
  • apps/local-ui traces "rows render": matched the text "1", present on almost any page. It now finds the row's Trace GET / link.

Verification
Ran each touched file: local-ui log-sheet + traces scene tests (14 passed), packages/ui ELK node test + legend-slot browser test (14 passed). oxlint shows one existing warning in the legend file (LoopHost, already on main).

Follow-ups not in this PR: most write-command scene tests check only the command name, not its args, and several threshold tests sit far from their cutoff.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Tests
    • Updated checks to expect the current trace link label and verify plot legend behavior on its first render.
    • Removed automated coverage for log-copy tooltips, runtime selection, service-map and timeline selection, and selected graph layout and ordering expectations.
    • These changes update the project’s automated checks; no end-user-facing behavior changes are described in this release.

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Walkthrough

The pull request updates UI test expectations, removes tests for several lab interactions, and removes service-map layout assertions. It also removes the @foldkit/ui dependency from the local UI package.

Changes: Local UI changes

Layer / File(s) Summary
Scene test expectations
apps/local-ui/src/page/kit/log-sheet/log-sheet.scene.test.ts, apps/local-ui/src/page/traces/traces.scene.test.ts, apps/local-ui/package.json
The trace scene test now expects the “Trace GET /” link. The log-sheet scene test no longer checks for the copy tooltip. The local UI package no longer lists @foldkit/ui as a dependency.

Web lab tests

Layer / File(s) Summary
Lab interaction test removals
apps/web/src/lab/gcp-filter-lab/update.test.ts, apps/web/src/lab/service-map-3d-lab/update.test.ts, apps/web/src/lab/timeline-lab/timeline-lab.test.ts
The removed tests covered runtime selection, service-map node selection, and timeline span selection.

Plot legend test

Layer / File(s) Summary
First-render hook assertion
packages/ui/src/components/plot/__tests__/legend-slot-hoisting.browser.test.tsx
A render-time recorder captures the hook result. The test now asserts its first recorded value instead of checking for nonempty DOM.

Service-map ELK tests

Layer / File(s) Summary
Layout assertion removals
packages/ui/src/components/service-map/service-map-elk.test.ts
The tests no longer check the flat-graph aspect ratio, large-graph thoroughness, or cycle-breaking and model-order strategies.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

  • MapleTechLabs/maple#1805: Replaces the log-sheet copy path and adds coverage for rendered messages in the same scene test.
Merge Risk: Minimal · up to 46509

No actionable merge-blocking issue is established; the change is mergeable after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main changes: removing ineffective UI tests and correcting two assertions.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 3 files.

Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@maple-review-bot

maple-review-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 10/10 · safe to merge
Test-only change; both rewritten assertions were checked against the code they assert and can now fail.
no findings · tests not needed · risk low

Test-only cleanup: drops lab and ELK option-pin tests and rewrites two assertions that could never fail. Both rewritten checks are sound against the current code; safe to merge.

  • Legend-slot test records the hook's first-render answer instead of an always-non-empty DOM string
  • local-ui traces row test asserts the row's Trace GET / link instead of the text "1"
What was checked
  • role("link", { name: "Trace GET /" }) matches: rowLink sets aria-label to Trace ${rootSpanName} (view-row.ts:31)
  • usePlotLegendSlot returns slot !== null && items !== null during render (plot-frame.tsx:452), so answers[0] is true
  • Removing the lab/ELK tests leaves every remaining file balanced and free of unused imports (Mount, text, click still used)

bbcf5fd · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@maple-review-bot

maple-review-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 10/10 · safe to merge
Follow-up commit only drops an unused dependency; no @foldkit/ui import remains in apps/local-ui.
no findings · tests not needed · risk low

The follow-up commit drops @foldkit/ui from apps/local-ui, unused once the shared Tooltip test went, leaving the rest of the test-pruning PR as reviewed. Safe to merge.

  • @maple/local-ui no longer lists @foldkit/ui; bun.lock follows
What was checked
  • Grepped apps/local-ui at the head SHA: no @foldkit/ui import, CSS import or tailwind glob remains
  • @maple/web still declares @foldkit/ui, and apps/local-ui reaches it only through @maple/web/ui/* subpaths

965ce2d · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

…ot fail

- Remove three dev-lab tests that only re-check message forwarding the real
  components already test (service-map-3d, timeline, gcp-filter labs).
- Remove the local log sheet tooltip test, which re-ran the shared Tooltip
  open sequence already covered by its own scene test.
- Drop ELK layout option pins (aspect ratio, thoroughness, ordering) that only
  restate config; keep the flat vs namespaced and large-graph switch checks.
- legend slot: the first-render test asserted String(boolean) is non-empty;
  it now records the hook's first answer and expects true.
- local traces: "rows render" matched the text "1"; it now finds the row link.
@Makisuo
Makisuo force-pushed the chore/prune-ui-tests branch from 965ce2d to 4650952 Compare October 30, 2026 00:30
@maple-review-bot

maple-review-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 10/10 · safe to merge
Test-only change: both rewritten assertions were checked against the hook's first-render return and the row link's aria-label, and each can now fail.
no findings · tests covered · risk low

Removes UI tests that duplicated covered behaviour or pinned layout option strings, and replaces two assertions that could never fail with ones that can. Test-only and safe to merge.

What was checked
  • usePlotLegendSlot derives its answer at render (plot-frame.tsx:452), so answers[0] is true and a read-back-from-effect regression now fails the test
  • role("link", { name: "Trace GET /" }) matches the row's aria-label built from rootSpanName (view-row.ts:31, row-link.ts:27)
  • The removed ELK assertions were constant-vs-literal pins on DEFAULT_LAYOUT_CONFIG, which the repo's test-slop rules ban; the flat/compound and >300-node switch checks stay

4650952 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@Makisuo
Makisuo merged commit 550269b into main Oct 30, 2026
38 checks passed
@Makisuo
Makisuo deleted the chore/prune-ui-tests branch October 30, 2026 00:37
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