Repository navigation
(janitor/test-prune): remove kilo-chat tests that assert on source text or duplicate package coverage - #6720
Conversation
…package coverage Remove three kilo-chat component tests that add maintenance cost without protecting production behavior: - message-bubble-actions.test.ts re-tests buildMessageActionAvailability from @kilocode/kilo-chat, which is already covered more thoroughly by packages/kilo-chat/test/message-action-availability.test.ts (4 cases vs 2, with byte-identical assertions for the two duplicated cases). - message-bubble-layout.test.ts reads MessageBubble.tsx/MessageAttachment.tsx as text and asserts on literal strings, source offsets, and Tailwind classes. - attachment-control-labels.test.ts reads MessageInput.tsx/AttachmentPreviewChip.tsx as text and asserts on literal aria-label strings. None of these execute production code: the first duplicates the owning package's test, the latter two grep raw source files and cannot detect a runtime regression.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Verified this deletion-only PR against current HEAD. All three removed tests are either a strict subset of Files Reviewed (3 files)
Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0 Review guidance: REVIEW.md from base branch |
Summary
Deletes three tests in
apps/web/src/app/(app)/claw/kilo-chat/components/that add maintenance cost without protecting production behavior. Each is classified and its surviving coverage identified below.Deleted tests and classification
1.
message-bubble-actions.test.ts— Duplicate coverageRe-tests
buildMessageActionAvailabilityfrom@kilocode/kilo-chat, a shared package that owns this function. The owning package already covers it more thoroughly inpackages/kilo-chat/test/message-action-availability.test.ts:The web test cannot detect any regression the package test does not already catch. It is a strict subset duplicated at the same layer (unit). Surviving coverage:
packages/kilo-chat/test/message-action-availability.test.ts(runs in theworkspace-testsCI job viapnpm --filter @kilocode/kilo-chat test).2.
message-bubble-layout.test.ts— Implementation-detail / no production behaviorReads
MessageBubble.tsxandMessageAttachment.tsxas raw text vianode:fsand asserts on literal substrings, source offsets (indexOf), and Tailwind class names (justify-end,text-foreground). It never imports or executes the component.MessageBubble/MessageAttachmentis exercised).3.
attachment-control-labels.test.ts— Implementation-detail / no production behaviorSame anti-pattern: reads
MessageInput.tsxandAttachmentPreviewChip.tsxas text and asserts on literalaria-labelstrings. The labels are a real accessibility concern, but string-grepping source files does not verify the accessible name at runtime; it only pins source text and breaks on any unrelated refactor. A render-based assertion (not added here, per scope) is the correct way to guard this, and no such behavioral assertion exists today — so this test provides no behavioral protection to lose.Verification
Tests could not be executed in this environment: the Jest
workerSetup.tsrequires a PostgreSQL instance (creates/drops a per-worker database), which is unavailable here. The deleted tests are pure-unit tests, but they cannot be run locally to confirm the before/after pass state. Package-level typecheck/lint were unaffected (no source files changed).Why each cannot detect an additional plausible regression
message-bubble-actions.test.ts— strict subset of the package test at the same layer; nothing beyond the package test's failure modes.message-bubble-layout.test.ts— greps source text; no production module executes, so no runtime regression is observable.attachment-control-labels.test.ts— greps source text; asserts only that literals exist in the file, not that any behavior occurs.