Selaa lähdekoodia

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

master
Jaya Allamsetty 4 vuotta sitten
vanhempi
commit
fd313c1af7
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2
    2
      react/features/base/testing/functions.js

+ 2
- 2
react/features/base/testing/functions.js Näytä tiedosto

38
     const largeVideoParticipantId = getState()['features/large-video'].participantId;
38
     const largeVideoParticipantId = getState()['features/large-video'].participantId;
39
     const videoTrack = getTrackByMediaTypeAndParticipant(
39
     const videoTrack = getTrackByMediaTypeAndParticipant(
40
         getState()['features/base/tracks'], MEDIA_TYPE.VIDEO, largeVideoParticipantId);
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
     return videoTrack && !videoTrack.muted && (lastMediaEvent === 'playing' || lastMediaEvent === 'canplaythrough');
43
     return videoTrack && !videoTrack.muted && (lastMediaEvent === 'playing' || lastMediaEvent === 'canplaythrough');
44
 }
44
 }
54
     const videoTrack = getTrackByMediaTypeAndParticipant(getState()['features/base/tracks'], MEDIA_TYPE.VIDEO, id);
54
     const videoTrack = getTrackByMediaTypeAndParticipant(getState()['features/base/tracks'], MEDIA_TYPE.VIDEO, id);
55
     const lastMediaEvent = videoTrack?.lastMediaEvent;
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…
Peruuta
Tallenna