Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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-onboarding-wizard"]' ).click();
} );
await page.waitForSelector( '#amp-onboarding-wizard' );
await expect( page ).toClick( 'a', { text: 'Close' } );
await page.waitForSelector( '.wp-admin' );
await expect( page ).toMatchElement( 'h1', { text: 'Dashboard' } );
} );
it.skip( 'persists the mobile redirect setting off', async () => {
await completeWizard( { mode: 'reader', mobileRedirect: false } );
await visitAdminPage( 'admin.php', 'page=amp-options' );
await expect( page ).toClick( '.advanced-settings-container' );
await page.waitForSelector( toggleSelector );
await expect( page ).not.toMatchElement( `${ toggleSelector }:checked` );
} );
} );
afterEach( async () => {
await visitAdminPage( 'admin.php', 'page=amp-onboarding-wizard' );
await cleanUpSettings();
} );