Conversation
|
@thegreatalxx is attempting to deploy a commit to the TypeCell Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughA test was added to the SuggestionMenu test suite to verify that the emoji menu item is properly registered in the default slash menu. The test confirms that clicking the emoji item triggers the suggestion menu with the correct colon ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/core/src/extensions/SuggestionMenu/SuggestionMenu.test.ts (1)
144-161: LGTM — test correctly validates the emoji slash menu wiring.The new test cleanly asserts that the
"emoji"item exists in the default slash menu and that itsonItemClickdelegates toopenSuggestionMenu(":", { deleteTriggerCharacter: true, ignoreQueryLength: true }), which matches the implementation ingetDefaultSlashMenuItems.tsand theopenSuggestionMenusignature inSuggestionMenu.ts.One small optional nit:
vi.spyOnis not restored (nomockRestore()/vi.restoreAllMocks()). Since a fresh editor is created per test and destroyed at the end, this is harmless here, but adding a cleanup (or usingafterEach(() => vi.restoreAllMocks())) would make the suite more robust against future refactors that share editor instances across tests.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/core/src/extensions/SuggestionMenu/SuggestionMenu.test.ts` around lines 144 - 161, The test creates a spy with vi.spyOn(sm, "openSuggestionMenu") but never restores it; add cleanup to avoid leaking mocks across tests by restoring the spy or all mocks after each test. Update the test file to call mockRestore() on openSuggestionMenuSpy or add an afterEach hook that invokes vi.restoreAllMocks(), referencing the spy name openSuggestionMenuSpy and the vi.spyOn call in SuggestionMenu.test.ts so the mock is cleaned up after the test.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/core/src/extensions/SuggestionMenu/SuggestionMenu.test.ts`:
- Around line 144-161: The test creates a spy with vi.spyOn(sm,
"openSuggestionMenu") but never restores it; add cleanup to avoid leaking mocks
across tests by restoring the spy or all mocks after each test. Update the test
file to call mockRestore() on openSuggestionMenuSpy or add an afterEach hook
that invokes vi.restoreAllMocks(), referencing the spy name
openSuggestionMenuSpy and the vi.spyOn call in SuggestionMenu.test.ts so the
mock is cleaned up after the test.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3e40ccbd-d694-487c-93dc-baac7a41935b
📒 Files selected for processing (1)
packages/core/src/extensions/SuggestionMenu/SuggestionMenu.test.ts
Adds an emoji picker option to the slash menu. Fixes #808.
Summary by CodeRabbit