Skip to content

fix(ai-powerups): make the capability handler tests typecheck again - #5764

Open
adrians5j wants to merge 1 commit into
nextfrom
adrian/fix-capabilities-test-types-next
Open

adrians5j wants to merge 1 commit into
nextfrom
adrian/fix-capabilities-test-types-next

Conversation

@adrians5j

@adrians5j adrians5j commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

The next twin of #5761, which fixed the same five TypeScript errors on release/6.5.0. Same commit, cherry-picked clean.

They came from the review-fix commit in #5750: a regex rewrite that introduced a store helper left one call passing an extra null, one as a bare handler.mapToStorage(...) with a missing argument and an unknown result, and three reading stored.items[...] on an optional field. All five passed at runtime because vitest strips types, and CI's TypeScript job does not cover __tests__.

yarn check:test:types -p ai-powerups goes from 5 errors to 0, and 67 tests pass.

Workspace: wby-next9 · ✨ AI Powerups - Settings Area

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated capability storage checks to handle cases where persisted items are missing.
    • Aligned null-switch and override-storage tests to use the shared storage helper.

Five TypeScript errors in `CapabilitiesHandler.test.ts`, introduced by the
review-fix commit that added the `store` helper. A regex rewrite converted most
call sites but left two wrong: one still passed a second `null` to the
one-argument helper, and one was left as a bare `handler.mapToStorage(...)` with
a missing argument and an `unknown` result. The other three were
`stored.items[...]` on a field that is optional on `PersistedCapabilities`.

All five passed at runtime, because vitest strips types, and CI's TypeScript job
does not cover `__tests__`, so nothing caught them. `yarn check:test:types -p
ai-powerups` had 0 errors before the toggle work, 5 after it, and 0 now.

That the regression landed in a commit fixing a type-safety finding is the part
worth remembering: the suite passing is not the same as the tests typechecking.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🚓 Slop Cop

✅ Nothing worth flagging. The diff looks consistent with the PR's stated intent and the code-style rules.

Small, focused test-only fix that matches its stated intent (typecheck fixes in a single test file); no integrity or style issues found.

Automated, non-blocking heads-up from an LLM. It can be wrong — use your judgment. Regenerates on every push.

@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 2958925a-346b-4e94-bf39-d2c765be5a13

📥 Commits

Reviewing files that changed from the base of the PR and between 98f08fb and 059afac.

📒 Files selected for processing (1)
  • packages/ai-powerups/__tests__/features/Capabilities/CapabilitiesHandler.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

Capability storage tests now use the shared store helper for null-switch and override cases. Assertions use optional chaining when checking stored entries. The null-switch test still expects null to be stored as enabled.

Changes

Capability storage tests

Layer / File(s) Summary
Storage test assertions
packages/ai-powerups/__tests__/features/Capabilities/CapabilitiesHandler.test.ts
The tests use the shared store helper for null-switch and override cases. Assertions use optional chaining to check stored entries.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 059af

This change updates test calls and assertions without changing runtime behavior; no actionable merge risk is indicated.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
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 change: fixing type-checking errors in the AI Powerups capability handler tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

This branch has not been deployed

No deployments
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