Skip to content

Commit

Permalink
Fix failing e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Nov 11, 2024
1 parent 4af6150 commit 96aa13f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default () => ( element ) => {
}
value = element.getAttribute( 'contenteditable' );
element.setAttribute( 'contenteditable', 'false' );
defaultView.getSelection().removeAllRanges();
}

function onPointerUp() {
Expand Down
9 changes: 3 additions & 6 deletions test/e2e/specs/editor/various/multi-block-selection.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ test.describe( 'Multi-block selection (@firefox, @webkit)', () => {
] );
} );

test( 'should clear selection when clicking next to blocks (-firefox)', async ( {
test( 'should clear selection when clicking next to blocks', async ( {
page,
editor,
multiBlockSelectionUtils,
Expand All @@ -752,16 +752,13 @@ test.describe( 'Multi-block selection (@firefox, @webkit)', () => {
name: 'Block: Paragraph',
} )
.filter( { hasText: '1' } );
// For some reason in Chrome it requires two clicks, even though it
// doesn't when testing manually.
await paragraph1.click( {
position: { x: -1, y: 0 },
// Use force since it's outside the bounding box of the element.
force: true,
} );

await expect
.poll( multiBlockSelectionUtils.getSelectedFlatIndices )
.toEqual( [ 1 ] );

await paragraph1.click( {
position: { x: -1, y: 0 },
// Use force since it's outside the bounding box of the element.
Expand Down

0 comments on commit 96aa13f

Please sign in to comment.