fix: synchronize responsive navigation and soundtrack cue
This commit is contained in:
@@ -26,6 +26,21 @@ test.beforeEach(async ({ page }) => {
|
||||
});
|
||||
});
|
||||
|
||||
test("makes the required soundtrack gesture explicit while the visual drive is already running", async ({
|
||||
page,
|
||||
distUrl,
|
||||
}) => {
|
||||
await page.goto(distUrl, { waitUntil: "domcontentloaded" });
|
||||
|
||||
await expect(page.locator(".journey-canvas")).toBeVisible();
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Play soundtrack" }),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Start the drive" }),
|
||||
).toHaveCount(0);
|
||||
});
|
||||
|
||||
test("starts Web Audio synchronously from the visitor gesture and exposes accessible controls", async ({
|
||||
page,
|
||||
distUrl,
|
||||
@@ -38,7 +53,7 @@ test("starts Web Audio synchronously from the visitor gesture and exposes access
|
||||
window.addEventListener("click", (event) => {
|
||||
if (
|
||||
(event.target as HTMLElement | null)?.textContent?.includes(
|
||||
"START THE DRIVE",
|
||||
"PLAY SOUNDTRACK",
|
||||
)
|
||||
) {
|
||||
const state = window as unknown as {
|
||||
@@ -51,7 +66,7 @@ test("starts Web Audio synchronously from the visitor gesture and exposes access
|
||||
});
|
||||
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Start the drive" }),
|
||||
page.getByRole("button", { name: "Play soundtrack" }),
|
||||
).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "Mute sound" })).toHaveCount(0);
|
||||
await expect(page.getByRole("button", { name: "Sound volume" })).toHaveCount(
|
||||
@@ -67,7 +82,7 @@ test("starts Web Audio synchronously from the visitor gesture and exposes access
|
||||
)
|
||||
.toBe(0);
|
||||
|
||||
await page.getByRole("button", { name: "Start the drive" }).click();
|
||||
await page.getByRole("button", { name: "Play soundtrack" }).click();
|
||||
|
||||
await expect(page.getByRole("button", { name: "Mute sound" })).toBeVisible();
|
||||
await expect(
|
||||
@@ -109,7 +124,7 @@ test("keeps the compact controls usable and dismisses the upward panels", async
|
||||
distUrl,
|
||||
}) => {
|
||||
await page.goto(distUrl, { waitUntil: "domcontentloaded" });
|
||||
await page.getByRole("button", { name: "Start the drive" }).click();
|
||||
await page.getByRole("button", { name: "Play soundtrack" }).click();
|
||||
|
||||
const controls = page
|
||||
.getByRole("group", { name: "Drive controls" })
|
||||
@@ -167,7 +182,7 @@ test("persists native volume and keeps sound independent from Static motion", as
|
||||
distUrl,
|
||||
}) => {
|
||||
await page.goto(distUrl, { waitUntil: "domcontentloaded" });
|
||||
await page.getByRole("button", { name: "Start the drive" }).click();
|
||||
await page.getByRole("button", { name: "Play soundtrack" }).click();
|
||||
|
||||
await page.getByRole("button", { name: "Sound volume" }).click();
|
||||
const volume = page.getByLabel("Sound volume level");
|
||||
@@ -195,7 +210,7 @@ test("requires a direct visitor action after browser interruption without creati
|
||||
distUrl,
|
||||
}) => {
|
||||
await page.goto(distUrl, { waitUntil: "domcontentloaded" });
|
||||
await page.getByRole("button", { name: "Start the drive" }).click();
|
||||
await page.getByRole("button", { name: "Play soundtrack" }).click();
|
||||
|
||||
await page.evaluate(() => {
|
||||
const context = (window as unknown as { __audioContexts: AudioContext[] })
|
||||
@@ -242,7 +257,7 @@ test("shows a concise non-blocking message when initial audio start is rejected"
|
||||
});
|
||||
await page.goto(distUrl, { waitUntil: "domcontentloaded" });
|
||||
|
||||
await page.getByRole("button", { name: "Start the drive" }).click();
|
||||
await page.getByRole("button", { name: "Play soundtrack" }).click();
|
||||
|
||||
await expect(
|
||||
page.getByText("Audio unavailable. Continue without sound."),
|
||||
|
||||
Reference in New Issue
Block a user