Skip to content

fix(web): stop the card controls test mock leaking into the issue card suite - #398

Merged
imshashank merged 1 commit into
mainfrom
fix/web-test-workspace-provider-leak
Sep 5, 2026
Merged

imshashank merged 1 commit into
mainfrom
fix/web-test-workspace-provider-leak

Conversation

@imshashank

@imshashank imshashank commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

apps/web/tests/features/issues/card-controls.test.tsx mocked workspace-provider with a single useWorkspace export and never restored it. Bun keeps a module mock for the rest of the process, so whichever test file loaded the provider next lost statesForTeam, and the seven IssueCard tests failed with states.filter on undefined. Which file came next depended on directory order, which is why main (3170e754) and every open pull request went red on the same seven tests this week while nothing touched that code.

The mock now spreads the real module, carries an empty states list, and is restored after the file. issue-card.test.tsx mocks the provider itself with the real hook so it no longer depends on what ran before it.

How you know it works

  • card-controls.test.tsx followed by issue-card.test.tsx in one process reproduced the failure before the change and passes after it (18/18).
  • tests/features/issues passes: 336 tests across 28 files. One 20s timeout on the reviewer cap dialog test under the full directory run passes on its own and is unrelated.
  • Lint and comment policy clean.

Checklist

  • Tests added or updated, and they fail without the change
  • No comments added to code, and no em-dash characters anywhere
  • No any, no non-null assertions

🤖 Generated with Claude Code

https://claude.ai/code/session_011VF2UUVK1HnXDdyf64eDiE

Greptile Summary

This PR isolates workspace-provider mocks in the issue test suites so test behavior does not depend on file execution order.

  • Restores the workspace-provider module after each affected test file.
  • Preserves the provider’s real exports while overriding only the workspace data needed by card-controls tests.
  • Gives issue-card tests an explicit real useWorkspace implementation.

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified.

The changed mocks preserve complete provider exports, supply the workspace fields used by the tests, and are isolated under the repository’s pinned test runtime.

Important Files Changed

Filename Overview
apps/web/tests/features/issues/card-controls.test.tsx Preserves the real workspace-provider exports, supplies stable members and states, and restores mocked modules after the suite.
apps/web/tests/features/issues/issue-card.test.tsx Explicitly installs and restores the real workspace hook so the suite remains isolated from neighboring module mocks.

Reviews (1): Last reviewed commit: "fix(web): stop the card controls test mo..." | Re-trigger Greptile

…d suite

card-controls.test.tsx replaced the whole workspace provider module with a
single useWorkspace export and never restored it. bun keeps module mocks for
the rest of the process, so whichever file loaded the provider next lost
statesForTeam and the seven IssueCard tests failed with states.filter on
undefined. Which file ran next depended on directory order, which is why
main and every pull request went red at random this week.

The mock now spreads the real module, carries an empty states list and is
restored after the file. The issue card suite mocks the provider itself
with the real hook so it no longer depends on what ran before it.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_011VF2UUVK1HnXDdyf64eDiE
@imshashank
imshashank requested a review from pulkitxm as a code owner September 5, 2026 13:09
@vercel

vercel Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
orbit Ready Ready Preview Sep 5, 2026 1:10pm UTC

Request Review

@github-actions github-actions Bot added tests Test coverage and test infrastructure area: web The Next.js app and its UI labels Sep 5, 2026
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: fe75c706-ac9c-4b8c-b152-c59937bdb88f

📥 Commits

Reviewing files that changed from the base of the PR and between d6e759d and a2944b1.

📒 Files selected for processing (2)
  • apps/web/tests/features/issues/card-controls.test.tsx
  • apps/web/tests/features/issues/issue-card.test.tsx

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

@imshashank
imshashank merged commit 552976c into main Sep 5, 2026
15 checks passed
@imshashank
imshashank deleted the fix/web-test-workspace-provider-leak branch September 5, 2026 13:27

This branch was successfully deployed

1 active deployment
Preview — a2944b1b Deployed Sep 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: web The Next.js app and its UI tests Test coverage and test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant