From 7c717202f25ec657d429fac9b4b330c2300bcbbc Mon Sep 17 00:00:00 2001
From: mgamis-msft <79475487+mgamis-msft@users.noreply.github.com>
Date: Tue, 3 Dec 2024 07:11:56 +0000
Subject: [PATCH] lint fixes

---
 .../tests/browser/VideoGallery.spec.tsx             | 13 ++++++-------
 .../tests/browser/call/hermetic/Pinning.test.ts     | 12 +++++++++---
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/packages/react-components/tests/browser/VideoGallery.spec.tsx b/packages/react-components/tests/browser/VideoGallery.spec.tsx
index 6587e763f05e..e30100f01c62 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(
       <Stack styles={{ root: { width: '100vw', height: '100vh' } }}>
@@ -134,8 +134,7 @@ test.describe('VGL - VideoGallery tests', () => {
       </Stack>
     );
     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(
       <Stack styles={{ root: { width: '100vw', height: '100vh' } }}>
         <VideoGallery
diff --git a/packages/react-composites/tests/browser/call/hermetic/Pinning.test.ts b/packages/react-composites/tests/browser/call/hermetic/Pinning.test.ts
index 72752f926560..7ffcd50b6340 100644
--- a/packages/react-composites/tests/browser/call/hermetic/Pinning.test.ts
+++ b/packages/react-composites/tests/browser/call/hermetic/Pinning.test.ts
@@ -30,7 +30,9 @@ const displayNames = [
 test.describe('PIN - Pinning tests', async () => {
   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' }));