@linktr.ee/messaging-react 4.1.6-rc-1787173663 → 4.1.6-rc-1787175518

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linktr.ee/messaging-react",
3
- "version": "4.1.6-rc-1787173663",
3
+ "version": "4.1.6-rc-1787175518",
4
4
  "description": "React messaging components built on messaging-core for web applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -50,7 +50,7 @@
50
50
  "chromatic:local": "yarn storybook:build && chromatic"
51
51
  },
52
52
  "dependencies": {
53
- "@linktr.ee/messaging-core": "2.5.0-rc-1787173663",
53
+ "@linktr.ee/messaging-core": "2.5.0-rc-1787175518",
54
54
  "@linktr.ee/messaging-taxonomy": "^0.10.0",
55
55
  "@phosphor-icons/react": "^2.1.10"
56
56
  },
@@ -25,17 +25,6 @@ vi.mock('stream-chat-react', async (importOriginal) => ({
25
25
  useChatContext: () => mockChatContext.current,
26
26
  }))
27
27
 
28
- vi.mock('../../hooks/useChannelStar', async (importOriginal) => {
29
- const actual =
30
- await importOriginal<typeof import('../../hooks/useChannelStar')>()
31
-
32
- return {
33
- ...actual,
34
- useChannelStar: (channel?: Channel) =>
35
- channel?.state ? actual.useChannelStar(channel) : false,
36
- }
37
- })
38
-
39
28
  type MockChannel = Channel & {
40
29
  emitMemberUpdated: (member?: { pinned_at?: string | null }) => void
41
30
  }
@@ -135,6 +124,7 @@ describe('CustomChannelPreview', () => {
135
124
  expect(row).not.toHaveClass('bg-black/[0.04]')
136
125
  expect(row).toHaveClass('hover:bg-black/[0.02]')
137
126
 
127
+ // Change unread only to force React.memo to rerender after the context change.
138
128
  rerender(
139
129
  <CustomChannelPreview {...defaultProps} channel={channel} unread={1} />
140
130
  )
@@ -194,9 +184,9 @@ describe('CustomChannelPreview', () => {
194
184
  expect(screen.getByText('Current User')).toBeInTheDocument()
195
185
  })
196
186
 
197
- it('renders safe fallbacks when channel state is unavailable', () => {
187
+ it('renders safe fallbacks when channel state is empty', () => {
198
188
  const channel = createMockChannel([])
199
- Object.assign(channel, { state: undefined })
189
+ Object.assign(channel, { state: {} })
200
190
 
201
191
  expect(() =>
202
192
  renderWithProviders(
@@ -205,6 +195,7 @@ describe('CustomChannelPreview', () => {
205
195
  ).not.toThrow()
206
196
  expect(screen.getByText('Unknown member')).toBeInTheDocument()
207
197
  expect(screen.getByText('No messages yet')).toBeInTheDocument()
198
+ expect(screen.queryByText('Starred conversation.')).not.toBeInTheDocument()
208
199
  })
209
200
 
210
201
  it('renders a participant image only when one is supplied', () => {
@@ -252,8 +243,9 @@ describe('CustomChannelPreview', () => {
252
243
  if (expectedBadge) {
253
244
  expect(screen.getByText(expectedBadge)).toBeInTheDocument()
254
245
  } else {
255
- expect(container.textContent).not.toContain('99+')
256
- expect(container.textContent).not.toMatch(/(?:^|\D)3(?:\D|$)/)
246
+ expect(
247
+ container.querySelector('span[class*="bg-[#7f22fe]"]')
248
+ ).not.toBeInTheDocument()
257
249
  }
258
250
  })
259
251