@linktr.ee/messaging-react 4.4.3-rc-1788180473 → 4.4.3-rc-1788180953
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.4.3-rc-
|
|
3
|
+
"version": "4.4.3-rc-1788180953",
|
|
4
4
|
"description": "React messaging components built on messaging-core for web applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"chromatic:local": "yarn storybook:build && chromatic"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@linktr.ee/messaging-core": "2.6.0-rc-
|
|
54
|
-
"@linktr.ee/messaging-taxonomy": "0.11.0-rc-
|
|
53
|
+
"@linktr.ee/messaging-core": "2.6.0-rc-1788180953",
|
|
54
|
+
"@linktr.ee/messaging-taxonomy": "0.11.0-rc-1788180953",
|
|
55
55
|
"@phosphor-icons/react": "^2.1.10"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { render, screen, waitFor } from '@testing-library/react'
|
|
2
2
|
import React, { useEffect } from 'react'
|
|
3
3
|
import { Channel as StreamChannel, StreamChat } from 'stream-chat'
|
|
4
4
|
import { Channel, Chat } from 'stream-chat-react'
|
|
@@ -75,42 +75,37 @@ describe('ChannelView outbound resolution', () => {
|
|
|
75
75
|
<RowProbe>{messageNode}</RowProbe>
|
|
76
76
|
)
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
</Chat>
|
|
90
|
-
).rerender
|
|
91
|
-
})
|
|
78
|
+
const { rerender } = render(
|
|
79
|
+
<Chat client={client}>
|
|
80
|
+
<Channel channel={channel as StreamChannel}>
|
|
81
|
+
<ChannelView
|
|
82
|
+
channel={channel as StreamChannel}
|
|
83
|
+
resolveOutbound={firstResolver}
|
|
84
|
+
renderMessage={renderMessage}
|
|
85
|
+
/>
|
|
86
|
+
</Channel>
|
|
87
|
+
</Chat>
|
|
88
|
+
)
|
|
92
89
|
|
|
90
|
+
await waitFor(() => expect(mounts).toHaveBeenCalledOnce())
|
|
93
91
|
expect(
|
|
94
92
|
screen.queryByTestId('sent-message-outbound-status')
|
|
95
93
|
).not.toBeInTheDocument()
|
|
96
|
-
expect(mounts).toHaveBeenCalledOnce()
|
|
97
94
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
)
|
|
110
|
-
})
|
|
95
|
+
rerender(
|
|
96
|
+
<Chat client={client}>
|
|
97
|
+
<Channel channel={channel as StreamChannel}>
|
|
98
|
+
<ChannelView
|
|
99
|
+
channel={channel as StreamChannel}
|
|
100
|
+
resolveOutbound={secondResolver}
|
|
101
|
+
renderMessage={renderMessage}
|
|
102
|
+
/>
|
|
103
|
+
</Channel>
|
|
104
|
+
</Chat>
|
|
105
|
+
)
|
|
111
106
|
|
|
112
107
|
expect(
|
|
113
|
-
screen.
|
|
108
|
+
await screen.findByTestId('sent-message-outbound-status')
|
|
114
109
|
).toHaveTextContent('July 9th Class absentee')
|
|
115
110
|
expect(mounts).toHaveBeenCalledOnce()
|
|
116
111
|
expect(unmounts).not.toHaveBeenCalled()
|
|
@@ -157,21 +157,20 @@ describe('MessagingProvider', () => {
|
|
|
157
157
|
// Re-render with a NEW inline serviceConfig object (same apiKey). The
|
|
158
158
|
// service is created once per client lifetime, so a serviceConfig change
|
|
159
159
|
// neither recreates the service nor tears down the live connection.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
)
|
|
173
|
-
})
|
|
160
|
+
rerender(
|
|
161
|
+
<MessagingProvider
|
|
162
|
+
apiKey="mock-api-key"
|
|
163
|
+
user={user}
|
|
164
|
+
serviceConfig={{
|
|
165
|
+
fetchToken: async () => 'token',
|
|
166
|
+
createChannel: async () => ({ channelId: 'ch-2' }),
|
|
167
|
+
}}
|
|
168
|
+
>
|
|
169
|
+
<div />
|
|
170
|
+
</MessagingProvider>
|
|
171
|
+
)
|
|
174
172
|
|
|
173
|
+
await waitFor(() => expect(connectUser).toHaveBeenCalledTimes(1))
|
|
175
174
|
expect(disconnectUser).not.toHaveBeenCalled()
|
|
176
175
|
})
|
|
177
176
|
|
|
@@ -203,19 +202,18 @@ describe('MessagingProvider', () => {
|
|
|
203
202
|
// Toggling `debug` changes the internal debugLog identity. The client
|
|
204
203
|
// cleanup must stay keyed on the client's lifetime, not on debugLog, so the
|
|
205
204
|
// live connection is not torn down for a logging change.
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
)
|
|
217
|
-
})
|
|
205
|
+
rerender(
|
|
206
|
+
<MessagingProvider
|
|
207
|
+
apiKey="mock-api-key"
|
|
208
|
+
user={user}
|
|
209
|
+
serviceConfig={serviceConfig}
|
|
210
|
+
debug={true}
|
|
211
|
+
>
|
|
212
|
+
<div />
|
|
213
|
+
</MessagingProvider>
|
|
214
|
+
)
|
|
218
215
|
|
|
216
|
+
await waitFor(() => expect(connectUser).toHaveBeenCalledTimes(1))
|
|
219
217
|
expect(disconnectUser).not.toHaveBeenCalled()
|
|
220
218
|
})
|
|
221
219
|
|
|
@@ -246,21 +244,19 @@ describe('MessagingProvider', () => {
|
|
|
246
244
|
await waitFor(() => expect(connectUser).toHaveBeenCalledTimes(1))
|
|
247
245
|
expect(connectUser).toHaveBeenLastCalledWith(guestUser)
|
|
248
246
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
)
|
|
263
|
-
})
|
|
247
|
+
rerender(
|
|
248
|
+
<MessagingProvider
|
|
249
|
+
key="authed"
|
|
250
|
+
apiKey="mock-api-key"
|
|
251
|
+
user={authedUser}
|
|
252
|
+
serviceConfig={{
|
|
253
|
+
fetchToken: async () => 'token',
|
|
254
|
+
createChannel: async () => ({ channelId: 'ch-1' }),
|
|
255
|
+
}}
|
|
256
|
+
>
|
|
257
|
+
<div />
|
|
258
|
+
</MessagingProvider>
|
|
259
|
+
)
|
|
264
260
|
|
|
265
261
|
await waitFor(() => expect(disconnectUser).toHaveBeenCalled())
|
|
266
262
|
await waitFor(() => expect(connectUser).toHaveBeenCalledTimes(2))
|