Skip to content

Commit

Permalink
Added e2e tests to test the transform of audio, video and image block…
Browse files Browse the repository at this point in the history
…s in to embeds when embeddable URLs are provided
  • Loading branch information
draganescu committed Feb 25, 2019
1 parent 3397ae4 commit 40628e4
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions packages/e2e-tests/specs/embedding.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,34 @@ describe( 'Embedding content', () => {
await clickButton( 'Try again' );
await page.waitForSelector( 'figure.wp-block-embed-twitter' );
} );

it( 'should transform from video to embed block when YouTube URL is pasted', async () => {
await clickBlockAppender();
await page.keyboard.type( '/video' );
await page.keyboard.press( 'Enter' );
await page.click( '.editor-media-placeholder__url-input-container button' );
await page.keyboard.type( 'https://www.youtube.com/watch?v=DQuhA5ZCV9M' );
await page.keyboard.press( 'Enter' );
await page.waitForSelector( '.wp-block-embed-youtube' );
} );

it( 'should transform from image to embed block when Instagram URL is pasted', async () => {
await clickBlockAppender();
await page.keyboard.type( '/image' );
await page.keyboard.press( 'Enter' );
await page.click( '.editor-media-placeholder__url-input-container button' );
await page.keyboard.type( 'https://www.instagram.com/p/BtNsR8HFRif/' );
await page.keyboard.press( 'Enter' );
await page.waitForSelector( '.wp-block-embed-instagram' );
} );

it( 'should transform from audio to embed block when Soundcloud URL is pasted', async () => {
await clickBlockAppender();
await page.keyboard.type( '/audio' );
await page.keyboard.press( 'Enter' );
await page.click( '.editor-media-placeholder__url-input-container button' );
await page.keyboard.type( 'https://soundcloud.com/a-boogie-wit-da-hoodie/swervin' );
await page.keyboard.press( 'Enter' );
await page.waitForSelector( '.wp-block-embed-soundcloud' );
} );
} );

0 comments on commit 40628e4

Please sign in to comment.