Skip to content

(janitor/test-prune): remove kilo-chat tests that assert on source text or duplicate package coverage - #6720

Merged
kilo-code-bot[bot] merged 1 commit into
mainfrom
janitor/test-prune-kilo-chat-components
Sep 25, 2026
Merged

kilo-code-bot[bot] merged 1 commit into
mainfrom
janitor/test-prune-kilo-chat-components

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

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 coverage

Re-tests buildMessageActionAvailability from @kilocode/kilo-chat, a shared package that owns this function. The owning package already covers it more thoroughly in packages/kilo-chat/test/message-action-availability.test.ts:

  • Web test asserts exactly 2 cases: persisted own message (all actions allowed) and pending message (all actions blocked).
  • Package test asserts 4 cases, including those 2 with byte-identical assertions, plus "other user's message" and "delivery-failed" cases.

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 the workspace-tests CI job via pnpm --filter @kilocode/kilo-chat test).

2. message-bubble-layout.test.ts — Implementation-detail / no production behavior

Reads MessageBubble.tsx and MessageAttachment.tsx as raw text via node:fs and asserts on literal substrings, source offsets (indexOf), and Tailwind class names (justify-end, text-foreground). It never imports or executes the component.

  • Cannot detect a runtime regression: a behavioral regression that leaves the pinned string intact passes; an equivalent refactor that changes the string fails.
  • Executes zero production code (no line/branch of MessageBubble/MessageAttachment is exercised).

3. attachment-control-labels.test.ts — Implementation-detail / no production behavior

Same anti-pattern: reads MessageInput.tsx and AttachmentPreviewChip.tsx as text and asserts on literal aria-label strings. 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

  • No other file references the deleted tests (grep returned no matches).
  • Diff is deletions only: 3 files, 113 lines removed, no production code touched.

Tests could not be executed in this environment: the Jest workerSetup.ts requires 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

  1. message-bubble-actions.test.ts — strict subset of the package test at the same layer; nothing beyond the package test's failure modes.
  2. message-bubble-layout.test.ts — greps source text; no production module executes, so no runtime regression is observable.
  3. attachment-control-labels.test.ts — greps source text; asserts only that literals exist in the file, not that any behavior occurs.

…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.
@kilo-code-bot kilo-code-bot Bot added the janitor Automated dead-code/duplication cleanup label Sep 25, 2026
@kilo-code-bot
kilo-code-bot Bot enabled auto-merge (squash) September 25, 2026 07:23
@kilo-code-bot

kilo-code-bot Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Verified this deletion-only PR against current HEAD. All three removed tests are either a strict subset of packages/kilo-chat/test/message-action-availability.test.ts (lines 21-27 and 43-49 are byte-identical to the two deleted web cases) or source-text greps (readFileSync on .tsx source) that execute no production code. No remaining file references the deleted test paths, so no config or import breaks. The loss of accessibility-label and attachment-URL source-string checks is explicitly disclosed in the PR body and those checks never exercised runtime behavior, so no behavioral coverage is lost.

Files Reviewed (3 files)
  • apps/web/src/app/(app)/claw/kilo-chat/components/attachment-control-labels.test.ts
  • apps/web/src/app/(app)/claw/kilo-chat/components/message-bubble-actions.test.ts
  • apps/web/src/app/(app)/claw/kilo-chat/components/message-bubble-layout.test.ts

Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

janitor Automated dead-code/duplication cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant