Skip to content

Commit

Permalink
Fix code reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin940726 committed Mar 3, 2023
1 parent 4b8857a commit 21b6549
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions test/e2e/specs/editor/various/multi-block-selection.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ test.describe( 'Multi-block selection', () => {
attributes: { content: '' },
} );
await editor.canvas
.getByRole( 'document', { name: /Empty block/i } )
.getByRole( 'document', { name: 'Empty block' } )
.click();
// Move to the middle of the first line.
await pageUtils.pressKeyTimes( 'ArrowUp', 4 );
Expand Down Expand Up @@ -532,9 +532,7 @@ test.describe( 'Multi-block selection', () => {
] );
await page.keyboard.press( 'Backspace' );

for ( let i = 0; i < 3; i += 1 ) {
await page.keyboard.press( 'ArrowLeft' );
}
await pageUtils.pressKeyTimes( 'ArrowLeft', 3 );
await pageUtils.pressKeyWithModifier( 'primary', 'v' );
await page.keyboard.type( '|' );
await expect
Expand Down Expand Up @@ -821,14 +819,22 @@ test.describe( 'Multi-block selection', () => {
.click();

await pageUtils.pressKeyWithModifier( 'primary', 'a' );
await expect
.poll( multiBlockSelectionUtils.getSelectedBlocks )
.toMatchObject( [ { name: 'core/list-item' } ] );

await pageUtils.pressKeyWithModifier( 'primary', 'a' );
await pageUtils.pressKeyWithModifier( 'primary', 'a' );
await expect
.poll( multiBlockSelectionUtils.getSelectedBlocks )
.toMatchObject( [ { name: 'core/list' } ] );

await pageUtils.pressKeyWithModifier( 'primary', 'a' );
await expect
.poll( multiBlockSelectionUtils.getSelectedBlocks )
.toContainEqual(
expect.objectContaining( { name: 'core/paragraph' } )
);
.toMatchObject( [
{ name: 'core/paragraph' },
{ name: 'core/list' },
] );
} );

test( 'should select all from empty selection', async ( {
Expand Down Expand Up @@ -1153,7 +1159,9 @@ test.describe( 'Multi-block selection', () => {
.click();

await page.keyboard.press( 'ArrowLeft' );
const strongText = page.getByText( '1', { exact: true } );
const strongText = editor.canvas
.getByRole( 'region', { name: 'Editor content' } )
.getByText( '1', { exact: true } );
const strongBox = await strongText.boundingBox();
await strongText.click( {
// Ensure clicking on the right half of the element.
Expand Down

0 comments on commit 21b6549

Please sign in to comment.