Skip to content

(janitor/test-prune): remove tautological and trivial tests - #7242

Merged
kilo-code-bot[bot] merged 1 commit into
mainfrom
janitor/test-prune-trivial-tests
Oct 8, 2026
Merged

kilo-code-bot[bot] merged 1 commit into
mainfrom
janitor/test-prune-trivial-tests

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes four test cases (one full file) that cannot detect a plausible production regression. Each was verified against its production source before deletion. No production code changed.

Removals and surviving coverage

1. apps/mobile/src/lib/should-show-run-on-selector.test.ts (deleted file)

  • Classification: asserts a constant; duplicate coverage.
  • shouldShowRunOnSelector unconditionally return true and ignores its _organizationId argument (the parameter is documented as "retained for call-site compatibility; it no longer gates visibility"). Four tests assert true for inputs the function never reads, so they exercise zero branches.
  • Why it can't fail: no production behavior change short of rewriting the stub to return a constant other than true would be caught, and no decision logic is protected. The intent ("personal and org flows both show the selector") is already documented in the function's docstring.
  • Surviving coverage: none required — the function has no branching behavior to cover.

2. packages/web-shared/src/lib/ai-gateway/transcriptions/transcription-request.test.ts — buildUpstreamBody

  • Classification: pass-through with no meaningful contract.
  • buildUpstreamBody is return body. The test asserts expect(buildUpstreamBody(body)).toEqual(body), i.e. deep-equality of an identity function with its own input.
  • Why it can't fail: any transformation regression that still returns a deep-equal value (e.g. cloning the object) passes; the field-filtering contract it implies is actually enforced by TranscriptionRequestSchema, which is tested directly in the same file.

3. packages/web-shared/src/lib/service-fees/checkout.test.ts — mergeServiceFeeCommercialMetadata

  • Classification: verifies JS object-spread union; dependency behavior.
  • The production function is { ...(existing ?? {}), ...commercial }. The test passes two non-overlapping key sets, so it only proves the language's spread-union semantics.
  • Why it can't fail: the function's one meaningful behavior — commercial overriding existing on key collision — is not exercised. Reversing the spread order (a plausible regression) leaves the test green.

4. packages/web-shared/src/lib/service-fees/tax.test.ts — buildInheritedInlineServiceFeeTaxInput

  • Classification: asserts a constant; duplicate coverage.
  • The function is return { source: 'inline_inherit' }. The standalone test restates that literal.
  • Surviving coverage: the public resolver resolveServiceFeeTaxInput test in the same file (the inline principal case) already asserts the identical { source: 'inline_inherit' } outcome through the real entry point.

Verification

  • apps/mobile: npx vitest run src/lib — 513 files / 6697 tests pass (the deleted file was the only change in that tree).
  • oxlint on the three modified web-shared files: 0 warnings, 0 errors.
  • oxfmt: changed files are formatted clean; git diff --check clean.
  • Not run: the web-shared Jest suites require a live PostgreSQL instance (per-worker test databases are created in apps/web/src/tests/setup/workerSetup.ts), which is not available in this environment. These are pure deletions of test code; the remaining test code already typechecked/linted before the change.

… coverage

Remove tests that cannot detect a plausible production regression:

- apps/mobile shouldShowRunOnSelector: the function unconditionally returns
  true and ignores its argument; four tests assert the same constant for
  inputs that are never read.
- web-shared buildUpstreamBody: an identity pass-through; the test asserts
  deep-equality with its own input.
- web-shared mergeServiceFeeCommercialMetadata: the test passes disjoint key
  sets, so it only verifies JS object-spread union and never exercises the
  function's override-precedence contract.
- web-shared buildInheritedInlineServiceFeeTaxInput: asserts a constant that
  is already covered by the resolveServiceFeeTaxInput resolver test.
@kilo-code-bot kilo-code-bot Bot added the janitor Automated dead-code/duplication cleanup label Oct 7, 2026
@kilo-code-bot
kilo-code-bot Bot enabled auto-merge (squash) October 7, 2026 07:57
@kilo-code-bot

kilo-code-bot Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Test-only pruning of four tautological or redundant tests; every removal was verified against the production source and no runtime code changed, so no behavioral risk was found.

Files Reviewed (4 files)
  • apps/mobile/src/lib/should-show-run-on-selector.test.ts
  • packages/web-shared/src/lib/ai-gateway/transcriptions/transcription-request.test.ts
  • packages/web-shared/src/lib/service-fees/checkout.test.ts
  • packages/web-shared/src/lib/service-fees/tax.test.ts

Verification Notes

  • shouldShowRunOnSelector unconditionally returns true and ignores _organizationId, so the four assertions exercised no branch.
  • Transcriptions buildUpstreamBody is return body; the test asserted deep equality of an identity function with its own input.
  • mergeServiceFeeCommercialMetadata is a spread merge; the removed test used disjoint key sets, so it only covered the union (the collision-override path was never exercised). The union behavior remains covered indirectly by call-site tests such as autoTopUp.test.ts asserting merged metadata.
  • buildInheritedInlineServiceFeeTaxInput returns the constant { source: 'inline_inherit' }, which resolveServiceFeeTaxInput still asserts in tax.test.ts.
  • All four production functions remain referenced by runtime code; no unused production symbols or unused test imports were introduced.

Reviewed by deepseek-v4.1-flash · Input: 46.9K · Output: 8.6K · Cached: 534.5K

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