Skip to content

Commit

Permalink
Improve test stability by waiting for selection (#47423)
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderBart authored Jan 26, 2023
1 parent 6517008 commit 416f517
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ describe( 'block editor keyboard shortcuts', () => {
it( 'should move the blocks up', async () => {
await createTestParagraphBlocks();
expect( await getEditedPostContent() ).toMatchSnapshot();
await page.keyboard.down( 'Shift' );
await page.keyboard.press( 'ArrowUp' );
await page.keyboard.up( 'Shift' );
await pressKeyWithModifier( 'shift', 'ArrowUp' );
await page.waitForSelector(
'[aria-label="Multiple selected blocks"]'
);
await moveUp();
expect( await getEditedPostContent() ).toMatchSnapshot();
} );
Expand All @@ -61,9 +62,10 @@ describe( 'block editor keyboard shortcuts', () => {
await createTestParagraphBlocks();
expect( await getEditedPostContent() ).toMatchSnapshot();
await page.keyboard.press( 'ArrowUp' );
await page.keyboard.down( 'Shift' );
await page.keyboard.press( 'ArrowUp' );
await page.keyboard.up( 'Shift' );
await pressKeyWithModifier( 'shift', 'ArrowUp' );
await page.waitForSelector(
'[aria-label="Multiple selected blocks"]'
);
await moveDown();
expect( await getEditedPostContent() ).toMatchSnapshot();
} );
Expand Down

0 comments on commit 416f517

Please sign in to comment.