@stream-io/video-client 1.40.2 → 1.40.3
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/CHANGELOG.md +7 -0
- package/dist/index.browser.es.js +3 -3
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +3 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +3 -3
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Call.ts +1 -1
- package/src/__tests__/StreamVideoClient.ringing.test.ts +26 -0
package/package.json
CHANGED
package/src/Call.ts
CHANGED
|
@@ -221,6 +221,32 @@ describe('StreamVideoClient Ringing', () => {
|
|
|
221
221
|
expect(oliverClient.state.calls[0]).toBe(call);
|
|
222
222
|
expect(call.ringing).toBe(true);
|
|
223
223
|
});
|
|
224
|
+
|
|
225
|
+
it('new call instance with doJoinRequest({ ring: true }) should replace old instance in store', async () => {
|
|
226
|
+
const callId = crypto.randomUUID();
|
|
227
|
+
|
|
228
|
+
const call = oliverClient.call('default', callId, {
|
|
229
|
+
reuseInstance: true,
|
|
230
|
+
});
|
|
231
|
+
const callCreatedEvent = expectEvent(oliverClient, 'call.created');
|
|
232
|
+
const serverCall = serverClient.video.call('default', callId);
|
|
233
|
+
await serverCall.create({
|
|
234
|
+
data: {
|
|
235
|
+
created_by_id: 'oliver',
|
|
236
|
+
members: [{ user_id: 'oliver' }, { user_id: 'sacha' }],
|
|
237
|
+
},
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
// the event arrives and since the store is empty registers a new IDLE call
|
|
241
|
+
await callCreatedEvent;
|
|
242
|
+
|
|
243
|
+
// join registers or updates the call
|
|
244
|
+
await call.doJoinRequest({ ring: true });
|
|
245
|
+
|
|
246
|
+
expect(oliverClient.state.calls.length).toBe(1);
|
|
247
|
+
expect(oliverClient.state.calls[0]).toBe(call);
|
|
248
|
+
expect(oliverClient.state.calls[0].ringing).toBe(true);
|
|
249
|
+
});
|
|
224
250
|
});
|
|
225
251
|
|
|
226
252
|
describe('ringing interruption', () => {
|