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

State: Trigger autosave as standard save for draft by current user #7130

Merged
merged 11 commits into from
Jun 20, 2018
Prev Previous commit
Next Next commit
Testing: Update published change detection test to use publishPost ut…
…ility
  • Loading branch information
aduth committed Jun 20, 2018
commit ae15eca8bcd0373b8711430004d2b6aa0171d80d
16 changes: 2 additions & 14 deletions test/e2e/specs/change-detection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
newDesktopBrowserPage,
pressWithModifier,
ensureSidebarOpened,
publishPost,
} from '../support/utils';

describe( 'Change detection', () => {
Expand Down Expand Up @@ -112,20 +113,7 @@ describe( 'Change detection', () => {
it( 'Should prompt to confirm unsaved changes for autosaved published post', async () => {
await page.type( '.editor-post-title__input', 'Hello World' );

await Promise.all( [
page.waitForSelector( '.editor-post-publish-button' ),
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' ),
] );
await publishPost();

// Close publish panel.
await Promise.all( [
Expand Down