Преглед изворни кода

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

j8
Jaya Allamsetty пре 4 година
родитељ
комит
fd313c1af7
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2
    2
      react/features/base/testing/functions.js

+ 2
- 2
react/features/base/testing/functions.js Прегледај датотеку

@@ -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…
Откажи
Сачувај