Skip to content

Commit

Permalink
Fix failing e2e testing due to additional of toolbar
Browse files Browse the repository at this point in the history
e2e tests were failing due to introduction of valign toolbar meaning that number of tab stops needed to be increased by 3 (the number of items in the new toolbar).

Also uncovered a bug with Pupeteer not handling Cmd + A to “Select All” on a Mac. This is a known issue (puppeteer/puppeteer#1313
) and it is now worked around using arrows and backspace.
  • Loading branch information
getdave committed Mar 19, 2019
1 parent c83a44e commit fcc6441
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions packages/e2e-tests/specs/block-hierarchy-navigation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe( 'Navigating the block hierarchy', () => {
await lastColumnsBlockMenuItem.click();

// Insert text in the last column block.
await pressKeyTimes( 'Tab', 2 ); // Navigate to the appender.
await pressKeyTimes( 'Tab', 5 ); // Navigate to the appender.
await page.keyboard.type( 'Third column' );

expect( await getEditedPostContent() ).toMatchSnapshot();
Expand Down Expand Up @@ -76,17 +76,19 @@ describe( 'Navigating the block hierarchy', () => {
await page.keyboard.press( 'Enter' );

// Insert text in the last column block
await pressKeyTimes( 'Tab', 2 ); // Navigate to the appender.
await pressKeyTimes( 'Tab', 5 ); // Navigate to the appender.
await page.keyboard.type( 'Third column' );

expect( await getEditedPostContent() ).toMatchSnapshot();
} );

it( 'should appear and function even without nested blocks', async () => {
const textString = 'You say goodbye';

await insertBlock( 'Paragraph' );

// Add content so there is a block in the hierachy.
await page.keyboard.type( 'You say goodbye' );
await page.keyboard.type( textString );

// Create an image block too.
await page.keyboard.press( 'Enter' );
Expand All @@ -96,8 +98,11 @@ describe( 'Navigating the block hierarchy', () => {
await openBlockNavigator();
await page.keyboard.press( 'Space' );

// Replace its content.
await pressKeyWithModifier( 'primary', 'A' );
// Replace its content
// note Cmd/Ctrl + A doesn't work on Mac with Pupetter right now
// https://github.com/GoogleChrome/puppeteer/issues/1313
await pressKeyTimes( 'ArrowRight', textString.length );
await pressKeyTimes( 'Backspace', textString.length );
await page.keyboard.type( 'and I say hello' );

expect( await getEditedPostContent() ).toMatchSnapshot();
Expand Down

0 comments on commit fcc6441

Please sign in to comment.