Skip to content

Commit

Permalink
E2E Tests: Suppress 404s in Embed Block test (#6820)
Browse files Browse the repository at this point in the history
  • Loading branch information
spacedmonkey committed Mar 19, 2021
1 parent 59889b2 commit 274e529
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/e2e-tests/src/specs/wordpress/webStoriesBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ import {
insertBlock,
} from '@web-stories-wp/e2e-test-utils';

/**
* Internal dependencies
*/
import { addAllowedErrorMessage } from '../../config/bootstrap';

const EMBED_BLOCK_CONTENT = `
<!-- wp:web-stories/embed {"url":"https://preview.amp.dev/documentation/examples/introduction/stories_in_amp","title":"Stories in AMP - Hello World","poster":"https://amp.dev/static/samples/img/story_dog2_portrait.jpg"} -->
<div class="wp-block-web-stories-embed alignnone"><amp-story-player style="width:360px;height:600px" data-testid="amp-story-player"><a href="https://preview.amp.dev/documentation/examples/introduction/stories_in_amp" style="--story-player-poster:url('https://amp.dev/static/samples/img/story_dog2_portrait.jpg')">Stories in AMP - Hello World</a></amp-story-player></div>
Expand All @@ -42,8 +47,12 @@ const EMBED_BLOCK_CONTENT = `

describe('Web Stories Block', () => {
let stopRequestInterception;
let removeErrorMessage;

beforeAll(async () => {
removeErrorMessage = addAllowedErrorMessage(
'Failed to load resource: the server responded with a status of 404'
);
await page.setRequestInterception(true);
stopRequestInterception = addRequestInterception((request) => {
// amp-story-player scripts
Expand Down Expand Up @@ -72,6 +81,7 @@ describe('Web Stories Block', () => {
afterAll(async () => {
await page.setRequestInterception(false);
stopRequestInterception();
removeErrorMessage();
});

it('should insert a new web stories block', async () => {
Expand Down

0 comments on commit 274e529

Please sign in to comment.