Skip to content

fix(tests): unblock tabs.test.ts — mock getTargetContextName + 5-arg createTarget#1121

Merged
shaun0927 merged 1 commit into
developfrom
fix/tabs-mock-mock-getTargetContextName
May 12, 2026
Merged

fix(tests): unblock tabs.test.ts — mock getTargetContextName + 5-arg createTarget#1121
shaun0927 merged 1 commit into
developfrom
fix/tabs-mock-mock-getTargetContextName

Conversation

@shaun0927
Copy link
Copy Markdown
Owner

Unblocks develop CI after #946 (isolatedContext) merge.

  • tests/utils/mock-session.ts — add getTargetContextName mock returning undefined.
  • tests/tools/tabs.test.ts — update 2 toHaveBeenCalledWith assertions to the new 5-arg createTarget signature.

Local: 18/18 passing.

🤖 Generated with Claude Code

…createTarget

Two regressions exposed by the #946 isolatedContext merge:

1. tests/utils/mock-session.ts — the mock SessionManager lacked
   `getTargetContextName()`, which the real implementation added in
   #946 and src/tools/tabs-context.ts now reads while building each
   TabInfo entry. Calling `undefined(targetId)` threw, silently
   caught by the surrounding try/catch, dropping the tab from the
   collected list. Stub the method as `jest.fn().mockReturnValue(undefined)`
   — tests do not exercise the named-context path, and the real
   method returns undefined for the default context too.

2. tests/tools/tabs.test.ts — the test's `toHaveBeenCalledWith`
   assertion for tabs_create.createTarget still listed only 4 args
   (sessionId, url, undefined, undefined). After #848/#946 the source
   passes a 5th `isolatedContext` arg. Update the two assertions to
   include the trailing undefined.

Local: tests/tools/tabs.test.ts → 18/18 passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@qodo-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@shaun0927 shaun0927 merged commit 2e25691 into develop May 12, 2026
2 of 9 checks passed
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