From 6791c7f4a3c6572b429c3c053042ffbc93f9d705 Mon Sep 17 00:00:00 2001 From: Ella Date: Tue, 3 Dec 2024 10:53:27 +0100 Subject: [PATCH] ensure clean prefs --- test/e2e/specs/site-editor/preload.spec.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/e2e/specs/site-editor/preload.spec.js b/test/e2e/specs/site-editor/preload.spec.js index 310c86e4e1f69c..4000eb0a300b51 100644 --- a/test/e2e/specs/site-editor/preload.spec.js +++ b/test/e2e/specs/site-editor/preload.spec.js @@ -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(); @@ -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 } ) => { @@ -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' ], ] ); } ); } );