Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2E Tests: Await embed error placeholder size class #20668

Merged
merged 1 commit into from
Mar 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions packages/e2e-tests/specs/editor/various/embedding.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,13 @@ describe( 'Embedding content', () => {
);
await page.keyboard.press( 'Enter' );

// Wait for the request to fail and present an error.
await page.waitForSelector( '.components-placeholder__error' );
// Wait for the request to fail and present an error. Since placeholder
// has styles applied which depend on resize observer, wait for the
// expected size class to settle before clicking, since otherwise a race
// condition could occur on the placeholder layout vs. click intent.
await page.waitForSelector(
'.components-placeholder.is-large .components-placeholder__error'
);

await clickButton( 'Convert to link' );
expect( await getEditedPostContent() ).toMatchSnapshot();
Expand All @@ -269,8 +274,13 @@ describe( 'Embedding content', () => {
);
await page.keyboard.press( 'Enter' );

// Wait for the request to fail and present an error.
await page.waitForSelector( '.components-placeholder__error' );
// Wait for the request to fail and present an error. Since placeholder
// has styles applied which depend on resize observer, wait for the
// expected size class to settle before clicking, since otherwise a race
// condition could occur on the placeholder layout vs. click intent.
await page.waitForSelector(
'.components-placeholder.is-large .components-placeholder__error'
);

// Set up a different mock to make sure that try again actually does make the request again.
await setUpResponseMocking( [
Expand Down