Skip to content

test(dashboard): pick an open chat's other mode the way the menu lists it now - #2218

Closed
ybai08 wants to merge 1 commit into
MODSetter:devfrom
ybai08:test/dashboard-open-chat-mode-menu
Closed

ybai08 wants to merge 1 commit into
MODSetter:devfrom
ybai08:test/dashboard-open-chat-mode-menu

Conversation

@ybai08

@ybai08 ybai08 commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What

One test in dashboard-page.test.tsx has failed on dev since d402901 (9 Oct): "opens a new chat in the mode picked in the composer, and offers an open chat's other mode as a new chat".

That commit changed an open chat's mode menu: it lists both modes as radio items, with the other one tagged "New chat", where it used to show a separate "Start a new chat in … mode" item. mode-picker.test.tsx was updated with it. The dashboard test walks the same menu and still looked for the old item:

TestingLibraryElementError: Unable to find role="menuitem" and name `/^Start a new chat in Agentic mode/`

It now clicks the menuitemradio named Agentic. What it asserts afterwards is unchanged: the composer is back on Agentic and the first chat's reply is gone, so a new chat was opened.

No application code changes.

Why

The Frontend step of Desktop Tests is red on dev's own runs for this one test (37990857120 and 37994261233, both 9 Oct), so it is red on every pull request since.

How to test

Run on macOS arm64, on dev at 6b6e21d30, from surfsense_local/frontend.

  • Before: pnpm exec vitest run --environment jsdom src/features/dashboard/dashboard-page.test.tsx fails this test, 3 runs of 3 (33 passed, 1 failed). The whole suite: 793 passed, 1 failed.
  • After: the file passes, 3 runs of 3 (34 passed). The whole suite: 794 passed in 102 files.
  • pnpm typecheck, pnpm lint: clean. prettier --check on the file: clean.

Not run: the backend suites (nothing there changes), and the app itself.

High-level PR Summary

This pull request fixes a failing test in dashboard-page.test.tsx that broke when the chat mode picker UI was changed from a separate "Start a new chat" menu item to radio buttons with a "New chat" tag. The test now clicks the correct menuitemradio element to match the updated UI, while keeping all assertions unchanged.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_local/frontend/src/features/dashboard/dashboard-page.test.tsx

Need help? Join our Discord

Summary by CodeRabbit

  • Tests
    • Updated a chat mode-switch test to select Agentic mode using the current menu option.

…s it now

d402901 made an open chat's mode menu list both modes as radio items, the
other one tagged "New chat", in place of a "Start a new chat in … mode" item.
The mode picker's own tests moved with it; the dashboard test that walks the
same menu still looked for the old item and has failed on dev since.
@ybai08
ybai08 requested a review from AnishSarkar22 as a code owner October 11, 2026 23:38
@vercel

vercel Bot commented Oct 11, 2026

Copy link
Copy Markdown

@ybai08 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: MODSetter/SurfSense/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 057ae3ee-af1a-46fc-a26a-47f7a3c67c81

📥 Commits

Reviewing files that changed from the base of the PR and between 7a41fcc and f19d71d.


📒 Files selected for processing (1)
  • surfsense_local/frontend/src/features/dashboard/dashboard-page.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.



📝 Walkthrough

Walkthrough

The dashboard test now selects Agentic mode from the open chat’s mode menu using a radio item. It retains assertions that Agentic mode is shown and the previous chat’s reply is absent.

Changes

Dashboard mode menu

Layer / File(s) Summary
Update mode-menu test
surfsense_local/frontend/src/features/dashboard/dashboard-page.test.tsx
The test selects the Agentic menuitemradio instead of the “Start a new chat in Agentic mode” menu item. It checks that both modes appear as radio items.

Priority: ⬇️ Low

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

Change: Other


Merge Risk: ⚪ Minimal · up to f19d7

This test-only update aligns the selector with the current menu while retaining its mode and prior-reply checks. No merge-blocking risk is identified.

Architecture Summary

Architecture risk: 🔵 Low · up to f19d7

The change affects 1 system.

Changed systems: surfsense_local

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — surfsense_local (ui) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in surfsense_local/frontend/src/features/dashboard/dashboard-page.test.tsx: The test now expects the open chat’s mode menu to offer both modes as radio items and selects the Agentic menuitemradio; it no longer selects the “Start a new chat in Agentic mode” menu item.

Pre-merge checks | Passed 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: updating the dashboard test to select the other chat mode using the current menu representation.
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 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@ybai08

ybai08 commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Closing: dev has this now. #2234 brought in 8bb3e0b ("test(chat): pick an open chat's other mode from its row in the dashboard test"), which fixes the same line and also asserts the row's "New chat" tag, so this one is redundant and conflicts with it.

@ybai08 ybai08 closed this Oct 12, 2026
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