-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Onboarding wizard close link: return to previous location
- Loading branch information
1 parent
11d6d6b
commit 436a87d
Showing
10 changed files
with
83 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
const { visitAdminPage } = require( '@wordpress/e2e-test-utils/build/visit-admin-page' ); | ||
/** | ||
* Internal dependencies | ||
*/ | ||
const { goToOnboardingWizard, completeWizard, cleanUpWizard } = require( '../../utils/onboarding-wizard-utils' ); | ||
|
||
describe( 'Onboarding wizard exit links', () => { | ||
it( 'if no previous page, returns to settings when clicking close', async () => { | ||
await goToOnboardingWizard(); | ||
await expect( page ).toClick( 'a', { text: 'Close' } ); | ||
await page.waitForSelector( '.wp-admin' ); | ||
await expect( page ).toMatchElement( 'h1', { text: 'AMP Settings' } ); | ||
} ); | ||
|
||
it( 'returns to previous page when clicking close', async () => { | ||
await visitAdminPage( 'index.php' ); | ||
await page.waitForSelector( '.wp-admin' ); | ||
|
||
await page.evaluate( () => { | ||
document.querySelector( 'a[href="admin.php?page=amp-setup"]' ).click(); | ||
} ); | ||
await page.waitForSelector( '#amp-setup' ); | ||
await expect( page ).toClick( 'a', { text: 'Close' } ); | ||
await page.waitForSelector( '.wp-admin' ); | ||
await expect( page ).toMatchElement( 'h1', { text: 'Dashboard' } ); | ||
} ); | ||
|
||
it( 'goes to settings when clicking finish', async () => { | ||
await completeWizard( { mode: 'standard' } ); | ||
await expect( page ).toClick( 'a', { text: 'Finish' } ); | ||
await page.waitForSelector( '.wp-admin' ); | ||
await expect( page ).toMatchElement( 'h1', { text: 'AMP Settings' } ); | ||
|
||
await goToOnboardingWizard(); | ||
await cleanUpWizard(); | ||
} ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters