Skip to content

test(web): migrate session-mounts-store test to the object-param mountFilesQueryFamily - #5437

Closed
mmabrouk wants to merge 1 commit into
mainfrom
fix/main-session-mounts-store-test
Closed

test(web): migrate session-mounts-store test to the object-param mountFilesQueryFamily#5437
mmabrouk wants to merge 1 commit into
mainfrom
fix/main-session-mounts-store-test

Conversation

@mmabrouk

Copy link
Copy Markdown
Member

Symptom

Two unit tests fail on main's own tip (verified in a clean clone of origin/main), which turns the required run-web-unit-tests check red for every open PR:

FAIL tests/unit/session-mounts-store.test.ts
  > fetches a session's mounts and one file tree per mount, shared by key
  > revalidate refetches ACTIVE queries and marks known mount files stale
AssertionError: expected undefined to deeply equal [...]

Both assert on mountFilesQueryFamily(...) data, which stays undefined forever.

Cause

The drive-surfaces data layer (#5400, commit e280384, landed via the v0.105.7 release merge) changed mountFilesQueryFamily's parameter from a plain mountId: string to {mountId, includeGitignored?} so the git-ignored toggle can key its own cache entry. All product callers were migrated (useSessionDrive.ts, useLazyDriveTree.tsx), but this unit test still passes the bare string. Destructuring {mountId} from a string yields undefined, so the query's enabled guard stays false, the fetch never runs, and data is undefined.

The store's behavior is correct; only the test was left on the old contract.

Fix

Update the test's six mountFilesQueryFamily(MOUNT.id) call sites to mountFilesQueryFamily({mountId: MOUNT.id}). No product code changes.

Tests

Full agenta-entities unit suite:

Test Files  63 passed (63)
     Tests  904 passed (904)

pnpm exec tsc --noEmit in the package: clean.

@mmabrouk mmabrouk added the needs-review Agent updated; awaiting Mahmoud's review label Jul 21, 2026
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 21, 2026
@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jul 21, 2026 3:58pm

Request Review

@dosubot dosubot Bot added the tests label Jul 21, 2026
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f63ce7fe-a739-4835-9515-4963e6cb25e8

📥 Commits

Reviewing files that changed from the base of the PR and between dd19a60 and 8751973.

📒 Files selected for processing (1)
  • web/packages/agenta-entities/tests/unit/session-mounts-store.test.ts

📝 Walkthrough

Summary by CodeRabbit

  • Tests
    • Updated session mount tests to reflect the latest query subscription format.
    • Expanded validation for mount file fetching, query revalidation, file-tree refetching after invalidation, and drive re-expansion behavior.

Walkthrough

Updated session mount store tests to pass mount identifiers through the object-form mountFilesQueryFamily({ mountId }) API in subscriptions, assertions, and resubscription logic.

Changes

Mount query test updates

Layer / File(s) Summary
Update mount query test calls
web/packages/agenta-entities/tests/unit/session-mounts-store.test.ts
Mount file-tree subscriptions, data assertions, and resubscription calls now use { mountId: MOUNT.id }.

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

Possibly related PRs

  • Agenta-AI/agenta#5432: Updates the same session mount store tests to use the object-form mountFilesQueryFamily argument.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: migrating the session-mounts-store test to the object-parameter API.
Description check ✅ Passed The description is directly related to the test update and explains the failing symptom, cause, and fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/main-session-mounts-store-test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@ardaerzin

Copy link
Copy Markdown
Contributor

closing as duplicate

@ardaerzin ardaerzin closed this Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Agent updated; awaiting Mahmoud's review size:XS This PR changes 0-9 lines, ignoring generated files. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants