diff --git a/packages/e2e-tests/specs/embedding.test.js b/packages/e2e-tests/specs/embedding.test.js index f4e04795ea2d3c..ff7d4396496e64 100644 --- a/packages/e2e-tests/specs/embedding.test.js +++ b/packages/e2e-tests/specs/embedding.test.js @@ -5,6 +5,7 @@ import { clickBlockAppender, createNewPost, createEmbeddingMatcher, + createURLMatcher, setUpResponseMocking, createJSONResponse, getEditedPostContent, @@ -124,6 +125,12 @@ const MOCK_RESPONSES = [ match: createEmbeddingMatcher( 'https://twitter.com/wooyaygutenberg123454312' ), onRequestMatch: createJSONResponse( MOCK_CANT_EMBED_RESPONSE ), }, + // Respond to the instagram URL with a non-image response, doesn't matter what it is, + // just make sure the image errors. + { + match: createURLMatcher( 'https://www.instagram.com/p/Bvl97o2AK6x/' ), + onRequestMatch: createJSONResponse( MOCK_CANT_EMBED_RESPONSE ), + }, ]; const addAllEmbeds = async () => { @@ -178,8 +185,10 @@ const addAllEmbeds = async () => { }; describe( 'Embedding content', () => { - beforeAll( async () => await setUpResponseMocking( MOCK_RESPONSES ) ); - beforeEach( createNewPost ); + beforeEach( async () => { + await setUpResponseMocking( MOCK_RESPONSES ); + await createNewPost(); + } ); it( 'should render embeds in the correct state', async () => { await addAllEmbeds();