@linktr.ee/messaging-react 4.1.6-rc-1787174531 → 4.1.6-rc-1787176721

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-1787174531",
3
+ "version": "4.1.6-rc-1787176721",
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-1787174531",
53
+ "@linktr.ee/messaging-core": "2.5.0-rc-1787176721",
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
  }
@@ -136,7 +125,15 @@ describe('CustomChannelPreview', () => {
136
125
  expect(row).toHaveClass('hover:bg-black/[0.02]')
137
126
 
138
127
  rerender(
139
- <CustomChannelPreview {...defaultProps} channel={channel} unread={1} />
128
+ <ChannelListProvider
129
+ value={{
130
+ selectedChannel: otherChannel,
131
+ onChannelSelect: defaultProps.onChannelSelect,
132
+ debug: false,
133
+ }}
134
+ >
135
+ <CustomChannelPreview {...defaultProps} channel={channel} unread={1} />
136
+ </ChannelListProvider>
140
137
  )
141
138
  expect(screen.getByRole('button')).toHaveClass('hover:bg-black/[0.02]')
142
139
  })
@@ -194,9 +191,9 @@ describe('CustomChannelPreview', () => {
194
191
  expect(screen.getByText('Current User')).toBeInTheDocument()
195
192
  })
196
193
 
197
- it('renders safe fallbacks when channel state is unavailable', () => {
194
+ it('renders safe fallbacks when channel state is empty', () => {
198
195
  const channel = createMockChannel([])
199
- Object.assign(channel, { state: undefined })
196
+ Object.assign(channel, { state: {} })
200
197
 
201
198
  expect(() =>
202
199
  renderWithProviders(
@@ -205,6 +202,7 @@ describe('CustomChannelPreview', () => {
205
202
  ).not.toThrow()
206
203
  expect(screen.getByText('Unknown member')).toBeInTheDocument()
207
204
  expect(screen.getByText('No messages yet')).toBeInTheDocument()
205
+ expect(screen.queryByText('Starred conversation.')).not.toBeInTheDocument()
208
206
  })
209
207
 
210
208
  it('renders a participant image only when one is supplied', () => {
@@ -252,9 +250,9 @@ describe('CustomChannelPreview', () => {
252
250
  if (expectedBadge) {
253
251
  expect(screen.getByText(expectedBadge)).toBeInTheDocument()
254
252
  } else {
255
- expect(screen.queryByText('0')).not.toBeInTheDocument()
256
- expect(container.textContent).not.toContain('99+')
257
- expect(container.textContent).not.toMatch(/(?:^|\D)3(?:\D|$)/)
253
+ expect(
254
+ container.querySelector('span[class*="bg-[#7f22fe]"]')
255
+ ).not.toBeInTheDocument()
258
256
  }
259
257
  })
260
258