Skip to content

Commit

Permalink
Add extra e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Mar 21, 2019
1 parent 2ea70db commit 2ca178c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/e2e-tests/specs/rich-text.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,22 @@ describe( 'RichText', () => {
expect( await getEditedPostContent() ).toMatchSnapshot();
} );

it( 'should not highlight more than one format', async () => {
await clickBlockAppender();
await pressKeyWithModifier( 'primary', 'b' );
await page.keyboard.type( '1' );
await pressKeyWithModifier( 'primary', 'b' );
await page.keyboard.type( ' 2' );
await pressKeyWithModifier( 'shift', 'ArrowLeft' );
await pressKeyWithModifier( 'primary', 'b' );

const count = await page.evaluate( () => document.querySelectorAll(
'*[data-rich-text-format-boundary]'
).length );

expect( count ).toBe( 1 );
} );

it( 'should return focus when pressing formatting button', async () => {
await clickBlockAppender();
await page.keyboard.type( 'Some ' );
Expand Down

0 comments on commit 2ca178c

Please sign in to comment.