Skip to content

Commit

Permalink
Make sure block is added before closing sidebar
Browse files Browse the repository at this point in the history
Maybe that's what is causing issues
  • Loading branch information
mleray committed Dec 9, 2024
1 parent 4ffdf09 commit 2328902
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tests/e2e/blocks/audio-video.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@ const MP3_TEST = 'https://www.greenpeace.org/static/planet4-assets/tests/wochens
*/
const addVideoOrAudioBlock = async ({page}, mediaType, mediaLink) => {
await searchAndInsertBlock({page}, mediaType, mediaType);

// Make sure the block has been added.
const insertUrl = await page.getByRole('button', {name: 'Insert from URL'});
await expect(insertUrl).toBeVisible();

// We should close the sidebar before editing the block.
const closeSidebar = await page.getByRole('button', {name: 'Close block inserter'});
if (await closeSidebar.isVisible()) {
await closeSidebar.click();
await expect(closeSidebar).toBeHidden();
}
await page.getByRole('button', {name: 'Insert from URL'}).click();
await closeSidebar.click();
await expect(closeSidebar).toBeHidden();

// Add the media URL.
await insertUrl.click();
await page.getByPlaceholder('Paste or type URL').fill(mediaLink);
await page.keyboard.press('Enter');
};
Expand Down

0 comments on commit 2328902

Please sign in to comment.