Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
E2E Tests: Use WHATWG URL in place of legacy url module
  • Loading branch information
aduth committed Mar 11, 2020
commit 26a0dbc0bd835961ad7e3644e2339cab020766ab
7 changes: 3 additions & 4 deletions packages/e2e-tests/specs/editor/various/preview.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* External dependencies
*/
import { last } from 'lodash';
import { parse } from 'url';

/**
* WordPress dependencies
Expand Down Expand Up @@ -187,9 +186,9 @@ describe( 'Preview', () => {
expect( previewTitle ).toBe( 'Hello World! And more.' );

// Published preview URL should include ID and nonce parameters.
const { query } = parse( previewPage.url(), true );
expect( query ).toHaveProperty( 'preview_id' );
expect( query ).toHaveProperty( 'preview_nonce' );
const { searchParams } = new URL( previewPage.url() );
expect( searchParams.has( 'preview_id' ) ).toBe( true );
expect( searchParams.has( 'preview_nonce' ) ).toBe( true );

// Return to editor. Previewing already-autosaved preview tab should
// reuse the opened tab, skipping interstitial. This resolves an edge
Expand Down