Skip to content

Update incorrect quote e2e test snapshot#43407

Merged
talldan merged 1 commit into
trunkfrom
update/incorrect-quote-snapshot
Aug 19, 2022
Merged

Update incorrect quote e2e test snapshot#43407
talldan merged 1 commit into
trunkfrom
update/incorrect-quote-snapshot

Conversation

@talldan
Copy link
Copy Markdown
Contributor

@talldan talldan commented Aug 19, 2022

What?

Closes #42814

Why?

The snapshot was committed with the wrong data. The test types a '2' character:

await page.keyboard.type( '2' );
// Expect the paragraph to be merged into the quote block.
expect( await getEditedPostContent() ).toMatchSnapshot();

But that's missing from the snapshot that was committed in #42780:

exports[`Quote can be split at the end 1`] = `
"<!-- wp:quote -->
<blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
<p>1</p>
<!-- /wp:paragraph --></blockquote>
<!-- /wp:quote -->
<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->"
`;

How?

Updates the snapshot.

It's likely this test is flakey and when the original snapshot that was generated in the PR was an instance where the test failed.

So I fully expect it to be reported as flakey again, and if that happens it might be worth skipping the test.

@talldan talldan added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Aug 19, 2022
@talldan talldan self-assigned this Aug 19, 2022
@talldan talldan merged commit cb84d6e into trunk Aug 19, 2022
@talldan talldan deleted the update/incorrect-quote-snapshot branch August 19, 2022 09:00
@github-actions github-actions Bot added this to the Gutenberg 14.0 milestone Aug 19, 2022
@ellatrix
Copy link
Copy Markdown
Member

Thanks! For me the test now fails locally.

We should add await page.evaluate( () => new Promise( window.requestIdleCallback ) ); before typing '2'. I added it in this PR:

https://github.com/WordPress/gutenberg/pull/42711/files#diff-fb8309a04b81f367af2589e71d50c3d767836848594660bf83bc0cd6b315bc38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Flaky Test] can be split at the end

2 participants