Conversation
WalkthroughExpanded EmojiContext to expose a direct custom-emoji lookup and native emoji caching; tests updated to mock the richer API. Emoji consumers switched from traversing Changes
Sequence Diagram(s)sequenceDiagram
participant Component as Component
participant EmojiContext as EmojiContext
participant CustomIdx as customEmojiIndex
participant NativeCache as nativeEmojiCache
participant Data as data.emojis
Component->>EmojiContext: findCustomEmoji(emojiId)
EmojiContext->>CustomIdx: Map.get(emojiId)
alt Custom emoji found
CustomIdx-->>EmojiContext: Emoji
EmojiContext-->>Component: Emoji
else Custom emoji not found
EmojiContext->>EmojiContext: findNativeEmoji(emojiId)
EmojiContext->>NativeCache: check cache
alt Cache hit
NativeCache-->>EmojiContext: NativeEmoji | null
else Cache miss
EmojiContext->>Data: normalized lookup (data.emojis[normalizedId])
Data-->>EmojiContext: NativeEmoji | null
EmojiContext->>NativeCache: store result
end
EmojiContext-->>Component: NativeEmoji | null
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ 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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (16)
__tests__/components/drops/create/lexical/nodes/EmojiNode.test.tsx(2 hunks)__tests__/components/drops/create/lexical/plugins/emoji/EmojiPlugin.test.tsx(1 hunks)__tests__/components/drops/view/part/DropPartMarkdown.test.tsx(1 hunks)__tests__/components/waves/CreateDropEmojiPicker.test.tsx(1 hunks)__tests__/components/waves/drops/WaveDropActions.test.tsx(1 hunks)__tests__/components/waves/drops/WaveDropActionsAddReaction.test.tsx(1 hunks)__tests__/components/waves/drops/WaveDropMobileMenu.test.tsx(1 hunks)__tests__/components/waves/drops/WaveDropReactions.test.tsx(5 hunks)__tests__/integration/EditDropFlow.test.tsx(1 hunks)components/brain/my-stream/layout/LayoutContext.tsx(3 hunks)components/brain/notifications/NotificationsCauseFilter.tsx(1 hunks)components/brain/notifications/drop-reacted/NotificationDropReacted.tsx(3 hunks)components/brain/notifications/hooks/useNotificationsScroll.ts(2 hunks)components/drops/create/lexical/nodes/EmojiNode.tsx(1 hunks)contexts/EmojiContext.tsx(2 hunks)hooks/useNotificationsQuery.tsx(3 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{ts,tsx}: Do not include any comments in the code
Use react-query for data fetching
Always add readonly before props
Files:
__tests__/integration/EditDropFlow.test.tsx__tests__/components/waves/drops/WaveDropActionsAddReaction.test.tsx__tests__/components/drops/create/lexical/nodes/EmojiNode.test.tsxcomponents/brain/notifications/drop-reacted/NotificationDropReacted.tsxcomponents/drops/create/lexical/nodes/EmojiNode.tsx__tests__/components/drops/view/part/DropPartMarkdown.test.tsx__tests__/components/waves/CreateDropEmojiPicker.test.tsx__tests__/components/waves/drops/WaveDropReactions.test.tsxcomponents/brain/notifications/NotificationsCauseFilter.tsxcomponents/brain/notifications/hooks/useNotificationsScroll.ts__tests__/components/waves/drops/WaveDropMobileMenu.test.tsxcontexts/EmojiContext.tsxhooks/useNotificationsQuery.tsx__tests__/components/drops/create/lexical/plugins/emoji/EmojiPlugin.test.tsx__tests__/components/waves/drops/WaveDropActions.test.tsxcomponents/brain/my-stream/layout/LayoutContext.tsx
**/*.tsx
📄 CodeRabbit inference engine (.cursorrules)
**/*.tsx: Use FontAwesome for icons
Use TailwindCSS for styling
Files:
__tests__/integration/EditDropFlow.test.tsx__tests__/components/waves/drops/WaveDropActionsAddReaction.test.tsx__tests__/components/drops/create/lexical/nodes/EmojiNode.test.tsxcomponents/brain/notifications/drop-reacted/NotificationDropReacted.tsxcomponents/drops/create/lexical/nodes/EmojiNode.tsx__tests__/components/drops/view/part/DropPartMarkdown.test.tsx__tests__/components/waves/CreateDropEmojiPicker.test.tsx__tests__/components/waves/drops/WaveDropReactions.test.tsxcomponents/brain/notifications/NotificationsCauseFilter.tsx__tests__/components/waves/drops/WaveDropMobileMenu.test.tsxcontexts/EmojiContext.tsxhooks/useNotificationsQuery.tsx__tests__/components/drops/create/lexical/plugins/emoji/EmojiPlugin.test.tsx__tests__/components/waves/drops/WaveDropActions.test.tsxcomponents/brain/my-stream/layout/LayoutContext.tsx
__tests__/**
📄 CodeRabbit inference engine (tests/AGENTS.md)
Place Jest test suites under the
__tests__directory mirroring source folders (e.g., components, contexts, hooks, utils)
Files:
__tests__/integration/EditDropFlow.test.tsx__tests__/components/waves/drops/WaveDropActionsAddReaction.test.tsx__tests__/components/drops/create/lexical/nodes/EmojiNode.test.tsx__tests__/components/drops/view/part/DropPartMarkdown.test.tsx__tests__/components/waves/CreateDropEmojiPicker.test.tsx__tests__/components/waves/drops/WaveDropReactions.test.tsx__tests__/components/waves/drops/WaveDropMobileMenu.test.tsx__tests__/components/drops/create/lexical/plugins/emoji/EmojiPlugin.test.tsx__tests__/components/waves/drops/WaveDropActions.test.tsx
__tests__/components/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (tests/AGENTS.md)
Use
@testing-library/reactand@testing-library/user-eventfor React component tests
Files:
__tests__/components/waves/drops/WaveDropActionsAddReaction.test.tsx__tests__/components/drops/create/lexical/nodes/EmojiNode.test.tsx__tests__/components/drops/view/part/DropPartMarkdown.test.tsx__tests__/components/waves/CreateDropEmojiPicker.test.tsx__tests__/components/waves/drops/WaveDropReactions.test.tsx__tests__/components/waves/drops/WaveDropMobileMenu.test.tsx__tests__/components/drops/create/lexical/plugins/emoji/EmojiPlugin.test.tsx__tests__/components/waves/drops/WaveDropActions.test.tsx
🧠 Learnings (12)
📓 Common learnings
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __mocks__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:07.561Z
Learning: Applies to __mocks__/**/__mocks__/**/*.{js,jsx,ts,tsx} : Keep mocks up to date with the real implementations they represent
📚 Learning: 2025-09-28T12:33:07.561Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __mocks__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:07.561Z
Learning: Applies to __mocks__/**/__mocks__/**/*.{js,jsx,ts,tsx} : Document non-obvious expected behaviour directly in the mock file
Applied to files:
__tests__/integration/EditDropFlow.test.tsx__tests__/components/waves/drops/WaveDropActionsAddReaction.test.tsx__tests__/components/drops/create/lexical/nodes/EmojiNode.test.tsx__tests__/components/drops/view/part/DropPartMarkdown.test.tsx__tests__/components/waves/CreateDropEmojiPicker.test.tsx__tests__/components/waves/drops/WaveDropReactions.test.tsx__tests__/components/waves/drops/WaveDropMobileMenu.test.tsx__tests__/components/drops/create/lexical/plugins/emoji/EmojiPlugin.test.tsx__tests__/components/waves/drops/WaveDropActions.test.tsx
📚 Learning: 2025-09-28T12:33:07.561Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __mocks__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:07.561Z
Learning: Applies to __mocks__/**/__mocks__/**/*.{js,jsx,ts,tsx} : Keep mocks up to date with the real implementations they represent
Applied to files:
__tests__/integration/EditDropFlow.test.tsx__tests__/components/waves/drops/WaveDropActionsAddReaction.test.tsx__tests__/components/drops/create/lexical/nodes/EmojiNode.test.tsx__tests__/components/drops/view/part/DropPartMarkdown.test.tsx__tests__/components/waves/CreateDropEmojiPicker.test.tsx__tests__/components/waves/drops/WaveDropReactions.test.tsx__tests__/components/waves/drops/WaveDropMobileMenu.test.tsx__tests__/components/drops/create/lexical/plugins/emoji/EmojiPlugin.test.tsx__tests__/components/waves/drops/WaveDropActions.test.tsx
📚 Learning: 2025-09-28T12:33:07.561Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __mocks__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:07.561Z
Learning: Applies to __mocks__/**/__mocks__/**/*.{js,jsx,ts,tsx} : Keep mock implementations minimal—only what’s necessary for the test scenarios
Applied to files:
__tests__/integration/EditDropFlow.test.tsx__tests__/components/waves/drops/WaveDropActionsAddReaction.test.tsx__tests__/components/drops/create/lexical/nodes/EmojiNode.test.tsx__tests__/components/drops/view/part/DropPartMarkdown.test.tsx__tests__/components/waves/CreateDropEmojiPicker.test.tsx__tests__/components/waves/drops/WaveDropReactions.test.tsx__tests__/components/waves/drops/WaveDropMobileMenu.test.tsx__tests__/components/drops/create/lexical/plugins/emoji/EmojiPlugin.test.tsx__tests__/components/waves/drops/WaveDropActions.test.tsx
📚 Learning: 2025-09-28T12:33:07.561Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __mocks__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:07.561Z
Learning: Applies to __mocks__/**/__mocks__/**/*.{js,jsx,ts,tsx} : Mock only external dependencies or heavy functionality; avoid over-mocking internal logic
Applied to files:
__tests__/integration/EditDropFlow.test.tsx__tests__/components/waves/drops/WaveDropActionsAddReaction.test.tsx__tests__/components/drops/create/lexical/nodes/EmojiNode.test.tsx__tests__/components/drops/view/part/DropPartMarkdown.test.tsx__tests__/components/waves/CreateDropEmojiPicker.test.tsx__tests__/components/waves/drops/WaveDropReactions.test.tsx__tests__/components/waves/drops/WaveDropMobileMenu.test.tsx__tests__/components/drops/create/lexical/plugins/emoji/EmojiPlugin.test.tsx__tests__/components/waves/drops/WaveDropActions.test.tsx
📚 Learning: 2025-09-28T12:33:07.561Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __mocks__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:07.561Z
Learning: Applies to __mocks__/**/__mocks__/**/*.{js,jsx,ts,tsx} : Review mocks periodically and remove unused mock modules
Applied to files:
__tests__/integration/EditDropFlow.test.tsx__tests__/components/waves/drops/WaveDropActionsAddReaction.test.tsx__tests__/components/drops/create/lexical/nodes/EmojiNode.test.tsx__tests__/components/drops/view/part/DropPartMarkdown.test.tsx__tests__/components/waves/CreateDropEmojiPicker.test.tsx__tests__/components/waves/drops/WaveDropReactions.test.tsx__tests__/components/waves/drops/WaveDropMobileMenu.test.tsx__tests__/components/drops/create/lexical/plugins/emoji/EmojiPlugin.test.tsx__tests__/components/waves/drops/WaveDropActions.test.tsx
📚 Learning: 2025-09-28T12:33:07.561Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __mocks__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:07.561Z
Learning: Applies to __mocks__/**/__mocks__/**/*.{js,jsx,ts,tsx} : Organise mocks to mirror the real module structure so import paths remain consistent
Applied to files:
__tests__/integration/EditDropFlow.test.tsx__tests__/components/waves/drops/WaveDropActionsAddReaction.test.tsx__tests__/components/drops/create/lexical/nodes/EmojiNode.test.tsx__tests__/components/drops/view/part/DropPartMarkdown.test.tsx__tests__/components/waves/CreateDropEmojiPicker.test.tsx__tests__/components/waves/drops/WaveDropReactions.test.tsx__tests__/components/waves/drops/WaveDropMobileMenu.test.tsx__tests__/components/drops/create/lexical/plugins/emoji/EmojiPlugin.test.tsx__tests__/components/waves/drops/WaveDropActions.test.tsx
📚 Learning: 2025-09-28T12:33:30.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:30.950Z
Learning: Applies to __tests__/components/**/*.{ts,tsx,js,jsx} : Use `testing-library/react` and `testing-library/user-event` for React component tests
Applied to files:
__tests__/integration/EditDropFlow.test.tsx__tests__/components/waves/drops/WaveDropActionsAddReaction.test.tsx__tests__/components/drops/create/lexical/nodes/EmojiNode.test.tsx__tests__/components/drops/view/part/DropPartMarkdown.test.tsx__tests__/components/waves/CreateDropEmojiPicker.test.tsx__tests__/components/waves/drops/WaveDropReactions.test.tsx__tests__/components/drops/create/lexical/plugins/emoji/EmojiPlugin.test.tsx__tests__/components/waves/drops/WaveDropActions.test.tsx
📚 Learning: 2025-09-28T12:33:07.561Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __mocks__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:07.561Z
Learning: Applies to __mocks__/**/*.{test,spec}.{js,jsx,ts,tsx} : In tests, use jest.mock('module') with a bare module specifier to load the corresponding manual mock
Applied to files:
__tests__/components/waves/drops/WaveDropActionsAddReaction.test.tsx__tests__/components/drops/view/part/DropPartMarkdown.test.tsx__tests__/components/waves/drops/WaveDropReactions.test.tsx__tests__/components/drops/create/lexical/plugins/emoji/EmojiPlugin.test.tsx__tests__/components/waves/drops/WaveDropActions.test.tsx
📚 Learning: 2025-09-28T12:33:07.561Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __mocks__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:07.561Z
Learning: Use Jest’s built-in mocking for module replacement; keep manual mocks simple and lightweight
Applied to files:
__tests__/components/drops/view/part/DropPartMarkdown.test.tsx__tests__/components/waves/drops/WaveDropReactions.test.tsx__tests__/components/waves/drops/WaveDropActions.test.tsx
📚 Learning: 2025-09-28T12:33:07.561Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __mocks__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:07.561Z
Learning: Applies to __mocks__/**/__mocks__/**/*.{js,jsx,ts,tsx} : Name mock files to mirror the real module names so jest.mock('module') can pick them up automatically
Applied to files:
__tests__/components/drops/view/part/DropPartMarkdown.test.tsx__tests__/components/waves/drops/WaveDropReactions.test.tsx__tests__/components/drops/create/lexical/plugins/emoji/EmojiPlugin.test.tsx__tests__/components/waves/drops/WaveDropActions.test.tsx
📚 Learning: 2025-09-28T12:33:07.561Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __mocks__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:07.561Z
Learning: Applies to __mocks__/**/__mocks__/**/*.{js,jsx,ts,tsx} : Place manual mock modules under a __mocks__ directory so Jest can auto-resolve them
Applied to files:
__tests__/components/waves/drops/WaveDropActions.test.tsx
🧬 Code graph analysis (4)
__tests__/components/drops/create/lexical/nodes/EmojiNode.test.tsx (1)
contexts/EmojiContext.tsx (1)
useEmoji(156-162)
components/brain/notifications/drop-reacted/NotificationDropReacted.tsx (1)
contexts/EmojiContext.tsx (1)
useEmoji(156-162)
components/drops/create/lexical/nodes/EmojiNode.tsx (1)
contexts/EmojiContext.tsx (1)
useEmoji(156-162)
__tests__/components/waves/drops/WaveDropReactions.test.tsx (1)
contexts/EmojiContext.tsx (1)
useEmoji(156-162)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (17)
components/brain/notifications/NotificationsCauseFilter.tsx (1)
54-61: LGTM! Efficient prefetch on hover.Limiting prefetch to 1 page on hover is a sensible optimization that reduces speculative data fetching while still warming the cache for likely navigation.
components/brain/notifications/drop-reacted/NotificationDropReacted.tsx (1)
49-118: LGTM! Cleaner emoji resolution.The refactored emoji lookup using dedicated
findCustomEmojiandfindNativeEmojihelpers is more maintainable and efficient than the previousemojiMaptraversal approach.components/brain/my-stream/layout/LayoutContext.tsx (2)
53-61: LGTM! Deduplication helper.The
spacesAreEqualfunction correctly compares all fields to enable state deduplication.
312-325: LGTM! State deduplication prevents unnecessary re-renders.The deduplication check using
spacesAreEqualensures state updates only occur when measurements actually change, improving performance.hooks/useNotificationsQuery.tsx (2)
84-96: LGTM! Optimized initial prefetch.Reducing initial prefetch to 1 page improves initial load performance while still warming the cache.
150-186: LGTM! Configurable prefetch with sensible default.The addition of the
pagesparameter with a default of 3 maintains backward compatibility while enabling callers to optimize prefetch behavior.__tests__/components/waves/drops/WaveDropMobileMenu.test.tsx (1)
45-55: LGTM! Mock updated to match API surface.The EmojiContext mock correctly includes the new
findCustomEmojifunction, keeping the test mock aligned with the real implementation. Based on learnings.__tests__/integration/EditDropFlow.test.tsx (1)
52-62: LGTM! Mock synchronized with API.The EmojiContext mock correctly includes
findCustomEmoji, maintaining consistency with the expanded context API. Based on learnings.__tests__/components/waves/CreateDropEmojiPicker.test.tsx (1)
67-74: LGTM! Complete mock with all context fields.The EmojiContext mock includes all necessary fields (
loading,findNativeEmoji,findCustomEmoji) while remaining minimal. Based on learnings.__tests__/components/waves/drops/WaveDropActions.test.tsx (1)
20-22: LGTM! Inline mock updated correctly.The EmojiContext mock includes
findCustomEmojialong with all other required fields, maintaining consistency across the test suite. Based on learnings.__tests__/components/drops/view/part/DropPartMarkdown.test.tsx (1)
67-74: EmojiContext mock matches expanded APIThanks for syncing this mock with the new context surface—having both findNativeEmoji and findCustomEmoji here will keep the markdown tests exercising the same contract the components rely on.
components/drops/create/lexical/nodes/EmojiNode.tsx (1)
73-76: findCustomEmoji lookup keeps decorator leanGood call switching to the dedicated finder—this keeps the node logic tidy while benefiting from the provider’s indexed lookup.
__tests__/components/waves/drops/WaveDropActionsAddReaction.test.tsx (1)
60-63: WaveDropActions emoji mock stays in syncAppreciate the fuller mock surface—this keeps the reaction flow exercising both native and custom resolution just like production.
__tests__/components/drops/create/lexical/nodes/EmojiNode.test.tsx (1)
30-55: EmojiNode tests cover both lookup pathsNice refresh—by routing through findCustomEmoji and stubbing native fallback you’ve kept these specs aligned with the runtime behavior.
__tests__/components/waves/drops/WaveDropReactions.test.tsx (1)
28-206: Helper centralizes emoji context setupThe shared factory + mock make these cases easier to follow while mirroring the provider’s API—great cleanup.
contexts/EmojiContext.tsx (1)
100-140: Caching + index tighten lookup costsIndexing custom emojis and memoizing native lookups should eliminate repeated scans while keeping the colon normalization intact—looks solid.
__tests__/components/drops/create/lexical/plugins/emoji/EmojiPlugin.test.tsx (1)
61-76: Mock updates correctly reflect the expanded EmojiContext API and component requirements.The mock setup is complete and accurate. The
emojiMapfield is actively used by theEmojiPlugincomponent to extract custom emoji IDs (seeEmojiPlugin.tslines 135-140), so it must remain in the mock. The additions ofloading,categories,categoryIcons, and thefindCustomEmojiimplementation correctly support the expanded API surface. The mock remains minimal and focused on test requirements.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
__tests__/components/waves/drops/create/lexical/nodes/EmojiNode.test.tsx (1)
4-4: Comments present in test file may violate coding guidelines.The coding guidelines specify "Do not include any comments in the code" for
**/*.{ts,tsx}files. While explanatory comments are common and helpful in test files, the guideline applies to all TypeScript files including tests. Consider whether these comments are essential or if the code can be self-documenting.As per coding guidelines
Also applies to: 11-11, 16-16, 24-24
🧹 Nitpick comments (2)
__tests__/components/waves/drops/create/lexical/nodes/EmojiNode.test.tsx (2)
106-106: Update test description to reflect the new API.The test description mentions "emojiMap" but the implementation now uses
findCustomEmojifor direct emoji lookup. Update the description to accurately reflect the new behavior.Apply this diff:
- it("renders <img> when emoji found in emojiMap", () => { + it("renders <img> when findCustomEmoji returns a custom emoji", () => {
113-137: Add verification thatfindCustomEmojiis called correctly.The test creates a mock for
findCustomEmojibut doesn't assert it was invoked with the expected argument. Add an expectation to ensure the component uses the new API correctly.Apply this diff after line 136:
expect(img).toHaveAttribute("src", fakeEmoji.skins[0].src); expect(img).toHaveAttribute("alt", "heart"); expect(img).toHaveClass("emoji-node"); + expect(findCustomEmoji).toHaveBeenCalledWith("heart"); });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
__tests__/components/brain/notifications/NotificationsCauseFilter.test.tsx(2 hunks)__tests__/components/waves/drops/create/lexical/nodes/EmojiNode.test.tsx(4 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{ts,tsx}: Do not include any comments in the code
Use react-query for data fetching
Always add readonly before props
Files:
__tests__/components/waves/drops/create/lexical/nodes/EmojiNode.test.tsx__tests__/components/brain/notifications/NotificationsCauseFilter.test.tsx
**/*.tsx
📄 CodeRabbit inference engine (.cursorrules)
**/*.tsx: Use FontAwesome for icons
Use TailwindCSS for styling
Files:
__tests__/components/waves/drops/create/lexical/nodes/EmojiNode.test.tsx__tests__/components/brain/notifications/NotificationsCauseFilter.test.tsx
__tests__/**
📄 CodeRabbit inference engine (tests/AGENTS.md)
Place Jest test suites under the
__tests__directory mirroring source folders (e.g., components, contexts, hooks, utils)
Files:
__tests__/components/waves/drops/create/lexical/nodes/EmojiNode.test.tsx__tests__/components/brain/notifications/NotificationsCauseFilter.test.tsx
__tests__/components/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (tests/AGENTS.md)
Use
@testing-library/reactand@testing-library/user-eventfor React component tests
Files:
__tests__/components/waves/drops/create/lexical/nodes/EmojiNode.test.tsx__tests__/components/brain/notifications/NotificationsCauseFilter.test.tsx
🧠 Learnings (7)
📚 Learning: 2025-09-28T12:33:07.561Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __mocks__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:07.561Z
Learning: Applies to __mocks__/**/__mocks__/**/*.{js,jsx,ts,tsx} : Document non-obvious expected behaviour directly in the mock file
Applied to files:
__tests__/components/waves/drops/create/lexical/nodes/EmojiNode.test.tsx
📚 Learning: 2025-09-28T12:33:07.561Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __mocks__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:07.561Z
Learning: Applies to __mocks__/**/__mocks__/**/*.{js,jsx,ts,tsx} : Keep mocks up to date with the real implementations they represent
Applied to files:
__tests__/components/waves/drops/create/lexical/nodes/EmojiNode.test.tsx
📚 Learning: 2025-09-28T12:33:07.561Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __mocks__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:07.561Z
Learning: Applies to __mocks__/**/__mocks__/**/*.{js,jsx,ts,tsx} : Keep mock implementations minimal—only what’s necessary for the test scenarios
Applied to files:
__tests__/components/waves/drops/create/lexical/nodes/EmojiNode.test.tsx
📚 Learning: 2025-09-28T12:33:30.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:30.950Z
Learning: Applies to __tests__/components/**/*.{ts,tsx,js,jsx} : Use `testing-library/react` and `testing-library/user-event` for React component tests
Applied to files:
__tests__/components/waves/drops/create/lexical/nodes/EmojiNode.test.tsx__tests__/components/brain/notifications/NotificationsCauseFilter.test.tsx
📚 Learning: 2025-09-28T12:33:07.561Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __mocks__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:07.561Z
Learning: Applies to __mocks__/**/__mocks__/**/*.{js,jsx,ts,tsx} : Mock only external dependencies or heavy functionality; avoid over-mocking internal logic
Applied to files:
__tests__/components/waves/drops/create/lexical/nodes/EmojiNode.test.tsx
📚 Learning: 2025-09-28T12:33:07.561Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __mocks__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:07.561Z
Learning: Applies to __mocks__/**/__mocks__/**/*.{js,jsx,ts,tsx} : Review mocks periodically and remove unused mock modules
Applied to files:
__tests__/components/waves/drops/create/lexical/nodes/EmojiNode.test.tsx
📚 Learning: 2025-09-28T12:33:07.561Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __mocks__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:07.561Z
Learning: Applies to __mocks__/**/__mocks__/**/*.{js,jsx,ts,tsx} : Organise mocks to mirror the real module structure so import paths remain consistent
Applied to files:
__tests__/components/waves/drops/create/lexical/nodes/EmojiNode.test.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (5)
__tests__/components/brain/notifications/NotificationsCauseFilter.test.tsx (2)
5-5: LGTM!The import is necessary for the enum references in the updated test assertion.
29-36: The cause array is correct; verification confirms buttons[1] maps to [IdentityMentioned, DropQuoted].The hardcoded causes match the component's filter definitions. Index 1 in the NotificationFilters array is the "Mentions" filter with exactly
[ApiNotificationCause.IdentityMentioned, ApiNotificationCause.DropQuoted]. Thepages: 1addition is also correct per the PR's configurable prefetch changes.Optional: Consider using
getByRole('button', { name: /mentions/i })instead ofbuttons[1]for better test resilience, though the current approach is functionally correct.__tests__/components/waves/drops/create/lexical/nodes/EmojiNode.test.tsx (3)
147-154: Verify whetheremojiMapis still required in the mocked context.Similar to the first test, if
emojiMapis no longer consumed by the component implementation, it can be removed from this mock as well.Based on learnings
168-168: Verify whetheremojiMapis still required in the mocked context.Same consideration as the previous tests—if
emojiMapis not used by the component, it can be omitted.Based on learnings
117-124: TheemojiMapmust remain in the mocked context.The EmojiContextType interface requires
emojiMapas a mandatory property. Additionally, multiple components throughout the codebase actively consume it (WaveDropReactions, WaveDropActionsAddReaction, CreateDropEmojiPicker, DropPartMarkdown, EmojiPlugin). The fact that EmojiNode usesfindCustomEmojifor lookups does not meanemojiMapcan be removed from the mock—the mock must satisfy the complete type definition that all consumers depend on.Likely an incorrect or invalid review comment.



Summary by CodeRabbit
Tests
Refactor