Skip to content

Commit 7c47f62

Browse files
committed
stabilize snapshots for VideoGallery component tests
1 parent 155281d commit 7c47f62

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

packages/react-components/tests/browser/VideoGallery.spec.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test.describe('VGL - VideoGallery tests', () => {
1212
await page.evaluate(() => document.fonts.ready);
1313
});
1414

15-
test('VideoGallery with only audio participants and dominant speakers', async ({ mount }) => {
15+
test('VideoGallery with only audio participants and dominant speakers', async ({ page, mount }) => {
1616
const localParticipant: VideoGalleryLocalParticipant = { userId: 'test' };
1717
const remoteParticipants: VideoGalleryRemoteParticipant[] = Array.from({ length: 10 }, (_, i) => i + 1).map(
1818
(i) => ({
@@ -29,6 +29,7 @@ test.describe('VGL - VideoGallery tests', () => {
2929
/>
3030
</Stack>
3131
);
32+
await page.waitForSelector('[key="next-nav-button"]', { timeout: 1000 });
3233
await expect(component).toHaveScreenshot('VGL-1-1-videogallery-with-audio-only-before-dominant-speakers.png');
3334
await component.update(
3435
<Stack styles={{ root: { width: '90vw', height: '90vh' } }}>
@@ -40,10 +41,11 @@ test.describe('VGL - VideoGallery tests', () => {
4041
/>
4142
</Stack>
4243
);
44+
await page.waitForSelector('[key="next-nav-button"]', { timeout: 1000 });
4345
await expect(component).toHaveScreenshot('VGL-1-2-videogallery-with-audio-only-after-dominant-speakers.png');
4446
});
4547

46-
test('VideoGallery with video participants and dominant speakers', async ({ mount }) => {
48+
test('VideoGallery with video participants and dominant speakers', async ({ page, mount }) => {
4749
const localParticipant: VideoGalleryLocalParticipant = { userId: 'test' };
4850
const remoteParticipants: VideoGalleryRemoteParticipant[] = Array.from({ length: 10 }, (_, i) => i + 1).map(
4951
(i) => ({
@@ -67,6 +69,7 @@ test.describe('VGL - VideoGallery tests', () => {
6769
/>
6870
</Stack>
6971
);
72+
await page.waitForSelector('[key="next-nav-button"]', { timeout: 1000 });
7073
await expect(component).toHaveScreenshot('VGL-2-1-videogallery-with-some-video-before-dominant-speakers.png');
7174
await component.update(
7275
<Stack styles={{ root: { width: '90vw', height: '90vh' } }}>
@@ -78,10 +81,11 @@ test.describe('VGL - VideoGallery tests', () => {
7881
/>
7982
</Stack>
8083
);
84+
await page.waitForSelector('[key="next-nav-button"]', { timeout: 1000 });
8185
await expect(component).toHaveScreenshot('VGL-2-2-videogallery--with-some-video-after-dominant-speakers.png');
8286
});
8387

84-
test('VideoGallery with screen share on and dominant speakers', async ({ mount }) => {
88+
test('VideoGallery with screen share on and dominant speakers', async ({ page, mount }) => {
8589
const localParticipant: VideoGalleryLocalParticipant = { userId: 'test' };
8690
const remoteParticipants: VideoGalleryRemoteParticipant[] = Array.from({ length: 10 }, (_, i) => i + 1).map(
8791
(i) => ({
@@ -100,6 +104,7 @@ test.describe('VGL - VideoGallery tests', () => {
100104
/>
101105
</Stack>
102106
);
107+
await page.waitForSelector('[key="next-nav-button"]', { timeout: 1000 });
103108
await expect(component).toHaveScreenshot('VGL-3-1-videogallery-with-screen-share-before-dominant-speakers.png');
104109
await component.update(
105110
<Stack styles={{ root: { width: '90vw', height: '90vw' } }}>
@@ -111,10 +116,11 @@ test.describe('VGL - VideoGallery tests', () => {
111116
/>
112117
</Stack>
113118
);
119+
await page.waitForSelector('[key="next-nav-button"]', { timeout: 1000 });
114120
await expect(component).toHaveScreenshot('VGL-3-2-videogallery-with-screen-share-after-dominant-speakers.png');
115121
});
116122

117-
test('VideoGallery spotlight participant test', async ({ mount }) => {
123+
test('VideoGallery spotlight participant test', async ({ page, mount }) => {
118124
const localParticipant: VideoGalleryLocalParticipant = { userId: 'test' };
119125
const remoteParticipants: VideoGalleryRemoteParticipant[] = Array.from({ length: 10 }, (_, i) => i + 1).map(
120126
(i) => ({ userId: `${i}`, displayName: `${i}` })
@@ -133,6 +139,7 @@ test.describe('VGL - VideoGallery tests', () => {
133139
/>
134140
</Stack>
135141
);
142+
await page.waitForSelector('[key="next-nav-button"]', { timeout: 1000 });
136143
await expect(component).toHaveScreenshot('VGL-4-1-videogallery-before-spotlight.png');
137144
remoteParticipants[7].spotlight = { spotlightedOrderPosition: 1 };
138145
component.update(
@@ -145,6 +152,7 @@ test.describe('VGL - VideoGallery tests', () => {
145152
/>
146153
</Stack>
147154
);
155+
await page.waitForSelector('[key="next-nav-button"]', { timeout: 1000 });
148156
await expect(component).toHaveScreenshot('VGL-4-2-videogallery-after-spotlight.png');
149157
});
150158
});

0 commit comments

Comments
 (0)