diff --git a/packages/react-components/tests/browser/VideoGallery.spec.tsx b/packages/react-components/tests/browser/VideoGallery.spec.tsx index 6587e763f05..0e68542c045 100644 --- a/packages/react-components/tests/browser/VideoGallery.spec.tsx +++ b/packages/react-components/tests/browser/VideoGallery.spec.tsx @@ -52,11 +52,11 @@ test.describe('VGL - VideoGallery tests', () => { }) ); // Assign video stream to some participants - remoteParticipants.find((p) => p.userId === '2')!.videoStream = { isAvailable: true }; - remoteParticipants.find((p) => p.userId === '3')!.videoStream = { isAvailable: true }; - remoteParticipants.find((p) => p.userId === '5')!.videoStream = { isAvailable: true }; - remoteParticipants.find((p) => p.userId === '7')!.videoStream = { isAvailable: true }; - remoteParticipants.find((p) => p.userId === '9')!.videoStream = { isAvailable: true }; + remoteParticipants.forEach((p) => { + if (p.userId in ['2', '3', '5', '7', '9']) { + p.videoStream = { isAvailable: true }; + } + }); const component = await mount( @@ -119,6 +119,7 @@ test.describe('VGL - VideoGallery tests', () => { const remoteParticipants: VideoGalleryRemoteParticipant[] = Array.from({ length: 10 }, (_, i) => i + 1).map( (i) => ({ userId: `${i}`, displayName: `${i}` }) ); + remoteParticipants[7].spotlight = { spotlightedOrderPosition: 1 }; const screenSharingParticipant: VideoGalleryRemoteParticipant = { userId: '11', displayName: '11' @@ -134,8 +135,6 @@ test.describe('VGL - VideoGallery tests', () => { ); await expect(component).toHaveScreenshot('VGL-4-1-videogallery-before-spotlight.png'); - - remoteParticipants.find((p) => p.userId === '8')!.spotlight = { spotlightedOrderPosition: 1 }; component.update(