Skip to content

Commit

Permalink
E2E Tests: Use WHATWG URL in place of legacy url module
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Mar 6, 2020
1 parent 49f8bdd commit 8a6acba
Showing 1 changed file with 3 additions and 4 deletions.
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

0 comments on commit 8a6acba

Please sign in to comment.