diff --git a/packages/react-components/tests/browser/VideoGallery.spec.tsx b/packages/react-components/tests/browser/VideoGallery.spec.tsx
index 6587e763f05..a6657d604cc 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[1].videoStream = { isAvailable: true };
+ remoteParticipants[2].videoStream = { isAvailable: true };
+ remoteParticipants[4].videoStream = { isAvailable: true };
+ remoteParticipants[6].videoStream = { isAvailable: true };
+ remoteParticipants[8].videoStream = { isAvailable: true };
const component = await mount(
@@ -134,8 +134,7 @@ 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 };
+ remoteParticipants[7].spotlight = { spotlightedOrderPosition: 1 };
component.update(
{
test('Pin and unpin remote participants via video tile', async ({ page, serverUrl }, testInfo) => {
const participants = displayNames.map((name) => defaultMockRemoteParticipant(name));
- addVideoStream(participants[1], true);
+ if (participants[1]) {
+ addVideoStream(participants[1], true);
+ }
const initialState = defaultMockCallAdapterState(participants);
await page.goto(buildUrlWithMockAdapter(serverUrl, initialState, { newControlBarExperience: 'true' }));
@@ -80,7 +82,9 @@ test.describe('PIN - Pinning tests', async () => {
test('Pin and unpin remote participants via participant item', async ({ page, serverUrl }, testInfo) => {
const participants = displayNames.map((name) => defaultMockRemoteParticipant(name));
- addVideoStream(participants[1], true);
+ if (participants[1]) {
+ addVideoStream(participants[1], true);
+ }
const initialState = defaultMockCallAdapterState(participants);
await page.goto(buildUrlWithMockAdapter(serverUrl, initialState, { newControlBarExperience: 'true' }));
@@ -130,7 +134,9 @@ test.describe('PIN - Pinning tests', async () => {
test('Pin max remote participants', async ({ page, serverUrl }, testInfo) => {
const participants = displayNames.map((name) => defaultMockRemoteParticipant(name));
- addVideoStream(participants[1], true);
+ if (participants[1]) {
+ addVideoStream(participants[1], true);
+ }
const initialState = defaultMockCallAdapterState(participants);
await page.goto(buildUrlWithMockAdapter(serverUrl, initialState, { newControlBarExperience: 'true' }));