mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 21:10:59 +00:00
test(e2e): skip the download-event assertions under mobile emulation
Playwright's mobile project (Pixel 5 / isMobile) treats a Blob + anchor click as a navigation and never emits a "download" event, so the two settings-export download tests time out only on chromium-mobile while passing on chromium-desktop. Skip them on mobile — the download wiring is engine behaviour, not viewport-dependent, and stays covered on desktop.
This commit is contained in:
1 parent
c275683e42
commit
e91a28fade
1 file changed
+11
@@ -64,7 +64,14 @@ test.describe("Settings → Export & Import", () => {
|
||||
|
||||
test("JSON import 'Download example' fires a real download", async ({
|
||||
page,
|
||||
isMobile,
|
||||
}) => {
|
||||
// Playwright's mobile emulation (Pixel 5 / isMobile) does not reliably
|
||||
// emit a `download` event for a Blob + anchor click — the click is treated
|
||||
// as a navigation, so `waitForEvent("download")` times out. The download
|
||||
// wiring is engine behaviour, not viewport-dependent, and is covered on the
|
||||
// chromium-desktop project; skip it on mobile rather than chase a flake.
|
||||
test.skip(isMobile, "downloads aren't observable under mobile emulation");
|
||||
await page.goto("/settings/export", { waitUntil: "domcontentloaded" });
|
||||
const exampleBtn = page.getByTestId("import-json-download-example");
|
||||
await expect(exampleBtn).toBeVisible({ timeout: 10_000 });
|
||||
@@ -107,7 +114,11 @@ test.describe("Settings → Export & Import", () => {
|
||||
|
||||
test("Measurements CSV download fires a real download event", async ({
|
||||
page,
|
||||
isMobile,
|
||||
}) => {
|
||||
// See the JSON-download test above: mobile emulation does not emit a
|
||||
// `download` event for the anchor click. Covered on chromium-desktop.
|
||||
test.skip(isMobile, "downloads aren't observable under mobile emulation");
|
||||
// Stub the API so we don't need 90 days of seeded data — the
|
||||
// browser-side wiring is what we're validating, not the route's
|
||||
// DB query.
|
||||
|
||||
Reference in new issue
Block a user