Explorar el Código

fix(tests): Add more checks so that test don't error out.

master
Jaya Allamsetty hace 4 años
padre
commit
fd313c1af7
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2
    2
      react/features/base/testing/functions.js

+ 2
- 2
react/features/base/testing/functions.js Ver fichero

@@ -38,7 +38,7 @@ export function isLargeVideoReceived({ getState }: Object): boolean {
38 38
     const largeVideoParticipantId = getState()['features/large-video'].participantId;
39 39
     const videoTrack = getTrackByMediaTypeAndParticipant(
40 40
         getState()['features/base/tracks'], MEDIA_TYPE.VIDEO, largeVideoParticipantId);
41
-    const lastMediaEvent = getState()['features/large-video'].lastMediaEvent;
41
+    const lastMediaEvent = getState()['features/large-video']?.lastMediaEvent;
42 42
 
43 43
     return videoTrack && !videoTrack.muted && (lastMediaEvent === 'playing' || lastMediaEvent === 'canplaythrough');
44 44
 }
@@ -54,5 +54,5 @@ export function isRemoteVideoReceived({ getState }: Object, id: String): boolean
54 54
     const videoTrack = getTrackByMediaTypeAndParticipant(getState()['features/base/tracks'], MEDIA_TYPE.VIDEO, id);
55 55
     const lastMediaEvent = videoTrack?.lastMediaEvent;
56 56
 
57
-    return !videoTrack.muted && (lastMediaEvent === 'playing' || lastMediaEvent === 'canplaythrough');
57
+    return videoTrack && !videoTrack.muted && (lastMediaEvent === 'playing' || lastMediaEvent === 'canplaythrough');
58 58
 }

Loading…
Cancelar
Guardar