Skip to content

Commit

Permalink
Fix e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Apr 24, 2021
1 parent e7dbc43 commit b98040a
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions packages/e2e-tests/specs/editor/various/navigable-toolbar.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
*/
import { createNewPost, pressKeyWithModifier } from '@wordpress/e2e-test-utils';

async function isInBlockToolbar() {
return await page.evaluate( () => {
return !! document.activeElement.closest(
'.block-editor-block-toolbar'
);
} );
}

describe.each( [
[ 'unified', true ],
[ 'contextual', false ],
Expand All @@ -21,18 +29,6 @@ describe.each( [
}, isUnifiedToolbar );
} );

const isInBlockToolbar = () =>
page.evaluate( ( _isUnifiedToolbar ) => {
if ( _isUnifiedToolbar ) {
return !! document.activeElement
.closest( '.edit-post-header-toolbar' )
.querySelector( '.block-editor-block-toolbar' );
}
return !! document.activeElement.closest(
'.block-editor-block-toolbar'
);
}, isUnifiedToolbar );

it( 'navigates in and out of toolbar by keyboard (Alt+F10, Escape)', async () => {
// Assumes new post focus starts in title. Create first new
// block by ArrowDown.
Expand Down

0 comments on commit b98040a

Please sign in to comment.