Skip to content

Commit

Permalink
Try closing the sidebar before adding url
Browse files Browse the repository at this point in the history
Maybe this is what is causing problems
  • Loading branch information
mleray committed Nov 20, 2024
1 parent bc731f2 commit e9c902d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/e2e/blocks/audio-video.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ const MP3_TEST = 'https://www.greenpeace.org/static/planet4-assets/tests/wochens
*/
const addVideoOrAudioBlock = async ({page}, mediaType, mediaLink) => {
await searchAndInsertBlock({page}, mediaType, mediaType);
// We should close the sidebar before editing the block.
const toggleSidebar = await page.getByRole('button', {name: 'Toggle block inserter'});
if (await toggleSidebar.getAttribute('aria-expanded') === 'true') {
await toggleSidebar.click();
}
await page.getByRole('button', {name: 'Insert from URL'}).click();
await page.getByPlaceholder('Paste or type URL').fill(mediaLink);
await page.keyboard.press('Enter');
Expand All @@ -35,8 +40,8 @@ test('check the Audio and Video blocks', async ({page, admin, editor}) => {
await addVideoOrAudioBlock({page}, 'video', MP4_TEST);

// Add Audio blocks with the various examples.
await addVideoOrAudioBlock({page}, 'audio', MP3_TEST);
await addVideoOrAudioBlock({page}, 'audio', SOUNDCLOUD_TEST);
await addVideoOrAudioBlock({page}, 'audio', MP3_TEST);

// Publish page.
await publishPostAndVisit({page, editor});
Expand Down

0 comments on commit e9c902d

Please sign in to comment.