Skip to content

Commit

Permalink
Testing: Wait for animation to avoid cursor chasing button
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Jun 5, 2018
1 parent 2348d4c commit f1ab2d3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/e2e/specs/change-detection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ describe( 'Change detection', () => {
page.click( '.editor-post-publish-panel__toggle' ),
] );

// Disable reason: Wait for animation to complete to avoid click
// occuring at wrong point.
// eslint-disable-next-line no-restricted-syntax
await page.waitFor( 100 );

await Promise.all( [
page.waitForSelector( '.editor-post-publish-panel__header-published' ),
page.click( '.editor-post-publish-button' ),
Expand All @@ -111,9 +116,9 @@ describe( 'Change detection', () => {

await Promise.all( [
page.waitForSelector( '.editor-post-publish-button.is-busy' ),
page.waitForSelector( '.editor-post-publish-button:not( .is-busy )' ),
page.evaluate( () => window.wp.data.dispatch( 'core/editor' ).autosave() ),
] );
await page.waitForSelector( '.editor-post-publish-button:not( .is-busy )' );

await assertIsDirty( true );
} );
Expand Down

0 comments on commit f1ab2d3

Please sign in to comment.