@@ -92,20 +92,20 @@ describe("VoiceBroadcastRecording", () => {
92
92
} ) ;
93
93
} ;
94
94
95
- const itShouldSendAnInfoEvent = ( state : VoiceBroadcastInfoState ) => {
95
+ const itShouldSendAnInfoEvent = ( state : VoiceBroadcastInfoState , lastChunkSequence : number ) => {
96
96
it ( `should send a ${ state } info event` , ( ) => {
97
97
expect ( client . sendStateEvent ) . toHaveBeenCalledWith (
98
98
roomId ,
99
99
VoiceBroadcastInfoEventType ,
100
100
{
101
-
102
101
device_id : client . getDeviceId ( ) ,
103
102
state,
103
+ last_chunk_sequence : lastChunkSequence ,
104
104
[ "m.relates_to" ] : {
105
105
rel_type : RelationType . Reference ,
106
106
event_id : infoEvent . getId ( ) ,
107
107
} ,
108
- } ,
108
+ } as VoiceBroadcastInfoEventContent ,
109
109
client . getUserId ( ) ,
110
110
) ;
111
111
} ) ;
@@ -203,22 +203,7 @@ describe("VoiceBroadcastRecording", () => {
203
203
voiceBroadcastRecording . stop ( ) ;
204
204
} ) ;
205
205
206
- it ( "should send a stopped Voice Broadcast Info event" , ( ) => {
207
- expect ( mocked ( client . sendStateEvent ) ) . toHaveBeenCalledWith (
208
- roomId ,
209
- VoiceBroadcastInfoEventType ,
210
- {
211
- device_id : client . getDeviceId ( ) ,
212
- state : VoiceBroadcastInfoState . Stopped ,
213
- [ "m.relates_to" ] : {
214
- rel_type : RelationType . Reference ,
215
- event_id : infoEvent . getId ( ) ,
216
- } ,
217
- } ,
218
- client . getUserId ( ) ,
219
- ) ;
220
- } ) ;
221
-
206
+ itShouldSendAnInfoEvent ( VoiceBroadcastInfoState . Stopped , 1 ) ;
222
207
itShouldBeInState ( VoiceBroadcastInfoState . Stopped ) ;
223
208
224
209
it ( "should emit a stopped state changed event" , ( ) => {
@@ -383,7 +368,7 @@ describe("VoiceBroadcastRecording", () => {
383
368
} ) ;
384
369
385
370
itShouldBeInState ( VoiceBroadcastInfoState . Paused ) ;
386
- itShouldSendAnInfoEvent ( VoiceBroadcastInfoState . Paused ) ;
371
+ itShouldSendAnInfoEvent ( VoiceBroadcastInfoState . Paused , 1 ) ;
387
372
388
373
it ( "should stop the recorder" , ( ) => {
389
374
expect ( mocked ( voiceBroadcastRecorder . stop ) ) . toHaveBeenCalled ( ) ;
@@ -424,7 +409,7 @@ describe("VoiceBroadcastRecording", () => {
424
409
} ) ;
425
410
426
411
itShouldBeInState ( VoiceBroadcastInfoState . Resumed ) ;
427
- itShouldSendAnInfoEvent ( VoiceBroadcastInfoState . Resumed ) ;
412
+ itShouldSendAnInfoEvent ( VoiceBroadcastInfoState . Resumed , 1 ) ;
428
413
429
414
it ( "should start the recorder" , ( ) => {
430
415
expect ( mocked ( voiceBroadcastRecorder . start ) ) . toHaveBeenCalled ( ) ;
0 commit comments