Repository navigation
test(ui): split markdown render-cache tests out of markdown.test.ts - #141497
Conversation
Main's check-lint-core-2 job fails because markdown.test.ts reached 1011 counted lines against the 1000-line max-lines limit. PRs #141431 and #141369 passed separately but combined to cross the limit when both landed. Move the cache-separation and large-text tests into a sibling file, preserving all 115 tests and their assertions without changing production code or lint rules.
|
🦞👀 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. Reviewed September 7, 2026, 3:39 PM ET / 19:39 UTC. ClawSweeper reviewWhat this changesMoves seven Markdown cache and large-text tests into a dedicated file while preserving their assertions. Merge readiness✅ Ready for maintainer review No actionable defects found. Current main already resolves the line-limit failure through a separate streaming-test split, so this PR now offers additional test organization rather than an urgent CI repair. Its maintainer protection rules out automated closure. Priority: P3 Review scores
Verification
How this fits togetherThe Control UI converts chat Markdown into sanitized HTML, caching eligible results by rendering options. These tests protect cache separation and readable fallback rendering for large messages. flowchart LR
A[Chat Markdown and options] --> B{Eligible for cache?}
B -->|Yes| C[Render cache]
B -->|No| D[Markdown or plain-text rendering]
C -->|Miss| D
D --> E[Sanitized HTML]
C -->|Hit| E
F[Cache and large-text tests] --> B
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +20. Total +20 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep cohesive Markdown test groups below the existing lint limit while retaining every behavioral assertion. Do we have a high-confidence way to reproduce the issue? Not applicable to a product defect: this is a test-file split, and current main's 900-line file no longer exceeds the stated 1000-line limit. Is this the best way to solve the issue? Yes, the relocation is a small, maintainable organization change that preserves coverage, although the separate split on main has already removed its original urgency. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 18eabd4cded9. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
ui/src/components/markdown.test.ts sits one line under the 700-line max-lines cap after #141466, #141485 and #141497 each moved a slice out. Move the toSanitizedMarkdownHtml code-block rendering cases into the existing markdown-code-blocks.test.ts, share htmlFragment and withControlUiBasePath from markdown.test-support.ts, and drop the copy of htmlFragment that markdown-streaming.test.ts carried. No assertion changes; the case count across ui/src/components/markdown*.test.ts is unchanged (232).
#141494) * test(ui): move code-block rendering tests beside their clipboard suite ui/src/components/markdown.test.ts sits one line under the 700-line max-lines cap after #141466, #141485 and #141497 each moved a slice out. Move the toSanitizedMarkdownHtml code-block rendering cases into the existing markdown-code-blocks.test.ts, share htmlFragment and withControlUiBasePath from markdown.test-support.ts, and drop the copy of htmlFragment that markdown-streaming.test.ts carried. No assertion changes; the case count across ui/src/components/markdown*.test.ts is unchanged (232). * test(ui): keep the html fence in the relocated escaping test The identifier rename that avoids shadowing lit's html import also rewrote the fence language inside one fixture string, changing what highlightCodeHtml exercised. Restore the fixture; the moved block is now identical to its origin apart from the local variable name.
…penclaw#141497) Main's check-lint-core-2 job fails because markdown.test.ts reached 1011 counted lines against the 1000-line max-lines limit. PRs openclaw#141431 and openclaw#141369 passed separately but combined to cross the limit when both landed. Move the cache-separation and large-text tests into a sibling file, preserving all 115 tests and their assertions without changing production code or lint rules.
openclaw#141494) * test(ui): move code-block rendering tests beside their clipboard suite ui/src/components/markdown.test.ts sits one line under the 700-line max-lines cap after openclaw#141466, openclaw#141485 and openclaw#141497 each moved a slice out. Move the toSanitizedMarkdownHtml code-block rendering cases into the existing markdown-code-blocks.test.ts, share htmlFragment and withControlUiBasePath from markdown.test-support.ts, and drop the copy of htmlFragment that markdown-streaming.test.ts carried. No assertion changes; the case count across ui/src/components/markdown*.test.ts is unchanged (232). * test(ui): keep the html fence in the relocated escaping test The identifier rename that avoids shadowing lit's html import also rewrote the fence language inside one fixture string, changing what highlightCodeHtml exercised. Restore the fixture; the moved block is now identical to its origin apart from the local variable name.
Related: #141431, #141369
What Problem This Solves
Resolves a problem where main's
check-lint-core-2job fails and blocks landings becausemarkdown.test.tsexceeds the 1000-line lint limit. PRs #141431 and #141369 passed separately but combined to bring the file to 1011 counted lines.Update: while this PR was in CI, #141466 separately extracted streaming tests and already relieved the main lint failure. This requested cache split adds further headroom and keeps cache-related coverage together.
Why This Change Was Made
Move the three render-cache separation tests and the related large-text handling group into
markdown.cache.test.ts. This test-only split preserves every test name and assertion, duplicates only the tiny DOM-fragment and JSON-block helpers, and leaves production code, lint configuration, thresholds, and ignores unchanged.User Impact
None. This restores CI headroom without changing product behavior or test coverage.
Evidence
node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json ui/src/components/markdown.test.ts ui/src/components/markdown.cache.test.ts: passed with no max-lines finding. The requestedui/tsconfig.jsondoes not exist; the repository's core lint config includes UI files. Physical line counts after splitting: 1090 and 105.node scripts/run-vitest.mjs ui/src/components/markdown.test.ts ui/src/components/markdown.cache.test.ts: 115 passed (108 + 7), matching the original file's 115 passed. All seven moved test bodies and the full test-name multiset are unchanged.pnpm check:changed: passed. Independent review: clean at P2.