File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed
playwright/e2e/right-panel Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff 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 ( / .+ \/ _ m a t r i x \/ m e d i a \/ \w + \/ d o w n l o a d \/ l o c a l h o s t \/ \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} ) ;
You can’t perform that action at this time.
0 commit comments