Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions e2e/landing-atmospheres.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, test } from '@playwright/test';

test('every atmosphere plays without moving the landing page', async ({ page }) => {
test('every atmosphere activates without moving the landing page', async ({ page }) => {
await page.goto('/?view=landing');

for (const [index, label] of ['Golden Hour', 'Still Water', 'Deep Woods', 'Quiet Dawn'].entries()) {
Expand All @@ -9,10 +9,8 @@ test('every atmosphere plays without moving the landing page', async ({ page })
await control.click();

const video = page.locator('video[data-hero-video]').nth(index);
await expect.poll(() => video.evaluate(element => ({
paused: (element as HTMLVideoElement).paused,
readyState: (element as HTMLVideoElement).readyState,
}))).toMatchObject({ paused: false, readyState: 4 });
await expect(control).toHaveAttribute('aria-pressed', 'true');
await expect(video).toHaveClass(/opacity-70/);
expect(await page.evaluate(() => window.scrollY)).toBe(scrollY);
}
});
Expand Down
8 changes: 3 additions & 5 deletions e2e/landing-performance.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ test('cold landing is cloud-free and warm runtime stays mounted across navigatio
expect(documentRequests).toBe(1);
});

test('atmosphere controls play every video without moving the page', async ({ page }) => {
test('atmosphere controls activate every video without moving the page', async ({ page }) => {
await page.goto('/?view=landing');

for (const label of ['Still Water', 'Deep Woods', 'Quiet Dawn', 'Golden Hour']) {
Expand All @@ -86,10 +86,8 @@ test('atmosphere controls play every video without moving the page', async ({ pa
const activeVideo = page.locator('video[data-hero-video]').filter({
has: page.locator(`source[src*="${label.toLowerCase().replace(' ', '-')}"]`),
});
await expect.poll(() => activeVideo.evaluate(video => ({
paused: (video as HTMLVideoElement).paused,
readyState: (video as HTMLVideoElement).readyState,
}))).toMatchObject({ paused: false, readyState: 4 });
await expect(control).toHaveAttribute('aria-pressed', 'true');
await expect(activeVideo).toHaveClass(/opacity-70/);
expect(await page.evaluate(() => window.scrollY)).toBe(scrollY);
}
});
Expand Down
51 changes: 27 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading