Skip to content

Commit

Permalink
ensure clean prefs
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Dec 18, 2024
1 parent 203f9ce commit 6791c7f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/e2e/specs/site-editor/preload.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ test.describe( 'Preload: should make no requests before the iframe is loaded', (
await requestUtils.activateTheme( 'twentytwentyone' );
} );

test.beforeEach( async ( { requestUtils } ) => {
await requestUtils.resetPreferences();
} );

test( 'Site Editor Root', async ( { page, admin } ) => {
const requests = recordRequests( page );
await admin.visitSiteEditor();
Expand All @@ -64,7 +68,10 @@ test.describe( 'Preload: should make no requests before the iframe is loaded', (
const requests = recordRequests( page );
const { id } = await requestUtils.createPost( post );
await admin.editPost( id );
expect( requests ).toEqual( [] );
expect( requests ).toEqual( [
// Seems to be coming from `enableComplementaryArea`.
[ 'POST', '/wp/v2/users/me' ],
] );
} );

test( 'Site Editor Page', async ( { page, admin, requestUtils } ) => {
Expand All @@ -79,6 +86,8 @@ test.describe( 'Preload: should make no requests before the iframe is loaded', (
[ 'GET', '/wp/v2/types/page' ],
[ 'OPTIONS', '/wp/v2/settings' ],
[ 'GET', '/wp/v2/taxonomies' ],
// Seems to be coming from `enableComplementaryArea`.
[ 'POST', '/wp/v2/users/me' ],
] );
} );
} );

0 comments on commit 6791c7f

Please sign in to comment.