Skip to content

Commit

Permalink
Try using close sidebar button
Browse files Browse the repository at this point in the history
This is instead of the toggle sidebar button
  • Loading branch information
mleray committed Dec 2, 2024
1 parent 2707d33 commit f50e625
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/e2e/blocks/audio-video.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ 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();
const closeSidebar = await page.getByRole('button', {name: 'Close block inserter'});
if (await closeSidebar.isVisible()) {
await closeSidebar.click();
}
await page.getByRole('button', {name: 'Insert from URL'}).click();
await page.getByPlaceholder('Paste or type URL').fill(mediaLink);
Expand Down

0 comments on commit f50e625

Please sign in to comment.