Skip to content

Commit e4d2206

Browse files
committed
Fix test
Signed-off-by: Michael Telatynski <[email protected]>
1 parent f1471e3 commit e4d2206

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

playwright/e2e/right-panel/file-panel.spec.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -189,23 +189,13 @@ test.describe("FilePanel", () => {
189189

190190
const link = imageBody.locator(".mx_MFileBody_download a");
191191

192-
const newPagePromise = context.waitForEvent("page");
193-
194-
const downloadPromise = new Promise<Download>((resolve) => {
195-
page.once("download", resolve);
196-
});
192+
const downloadPromise = page.waitForEvent("download");
197193

198194
// Click the anchor link (not the image itself)
199195
await link.click();
200196

201-
const newPage = await newPagePromise;
202-
// XXX: Clicking the link opens the image in a new tab on some browsers rather than downloading
203-
await expect(newPage)
204-
.toHaveURL(/.+\/_matrix\/media\/\w+\/download\/localhost\/\w+/)
205-
.catch(async () => {
206-
const download = await downloadPromise;
207-
expect(download.suggestedFilename()).toBe("riot.png");
208-
});
197+
const download = await downloadPromise;
198+
expect(download.suggestedFilename()).toBe("riot.png");
209199
});
210200
});
211201
});

0 commit comments

Comments
 (0)