Skip to content

Commit 6027a70

Browse files
authored
Remove redundant calls to disable the Styles welcome guide (#50871)
* Remove redundant calls to disable the Styles welcome guide * No need to manually add an editor as helper
1 parent be606d7 commit 6027a70

File tree

3 files changed

+4
-42
lines changed

3 files changed

+4
-42
lines changed

test/e2e/specs/site-editor/style-book.spec.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,17 +162,7 @@ class StyleBook {
162162
this.page = page;
163163
}
164164

165-
async disableWelcomeGuide() {
166-
// Turn off the welcome guide.
167-
await this.page.evaluate( () => {
168-
window.wp.data
169-
.dispatch( 'core/preferences' )
170-
.set( 'core/edit-site', 'welcomeGuideStyles', false );
171-
} );
172-
}
173-
174165
async open() {
175-
await this.disableWelcomeGuide();
176166
await this.page
177167
.getByRole( 'region', { name: 'Editor top bar' } )
178168
.getByRole( 'button', { name: 'Styles' } )

test/e2e/specs/site-editor/style-variations.spec.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,17 +217,7 @@ class SiteEditorStyleVariations {
217217
this.page = page;
218218
}
219219

220-
async disableWelcomeGuide() {
221-
// Turn off the welcome guide.
222-
await this.page.evaluate( () => {
223-
window.wp.data
224-
.dispatch( 'core/preferences' )
225-
.set( 'core/edit-site', 'welcomeGuideStyles', false );
226-
} );
227-
}
228-
229220
async browseStyles() {
230-
await this.disableWelcomeGuide();
231221
await this.page.click( 'role=button[name="Styles"i]' );
232222
await this.page.click( 'role=button[name="Browse styles"i]' );
233223
}

test/e2e/specs/site-editor/user-global-styles-revisions.spec.js

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
/**
22
* WordPress dependencies
33
*/
4-
const {
5-
test,
6-
expect,
7-
Editor,
8-
} = require( '@wordpress/e2e-test-utils-playwright' );
4+
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' );
95

106
test.use( {
11-
editor: async ( { page }, use ) => {
12-
await use( new Editor( { page } ) );
13-
},
147
userGlobalStylesRevisions: async ( { page, requestUtils }, use ) => {
158
await use( new UserGlobalStylesRevisions( { page, requestUtils } ) );
169
},
@@ -29,10 +22,9 @@ test.describe( 'Global styles revisions', () => {
2922
await requestUtils.activateTheme( 'twentytwentyone' );
3023
} );
3124

32-
test.beforeEach( async ( { admin } ) => {
33-
await admin.visitSiteEditor( {
34-
canvas: 'edit',
35-
} );
25+
test.beforeEach( async ( { admin, editor } ) => {
26+
await admin.visitSiteEditor();
27+
await editor.canvas.click( 'body' );
3628
} );
3729

3830
test( 'should display revisions UI when there is more than 1 revision', async ( {
@@ -131,15 +123,6 @@ class UserGlobalStylesRevisions {
131123
this.requestUtils = requestUtils;
132124
}
133125

134-
async disableWelcomeGuide() {
135-
// Turn off the welcome guide.
136-
await this.page.evaluate( () => {
137-
window.wp.data
138-
.dispatch( 'core/preferences' )
139-
.set( 'core/edit-site', 'welcomeGuideStyles', false );
140-
} );
141-
}
142-
143126
async getGlobalStylesRevisions() {
144127
const stylesPostId =
145128
await this.requestUtils.getCurrentThemeGlobalStylesPostId();
@@ -159,7 +142,6 @@ class UserGlobalStylesRevisions {
159142
}
160143

161144
async openStylesPanel() {
162-
await this.disableWelcomeGuide();
163145
await this.page
164146
.getByRole( 'region', { name: 'Editor top bar' } )
165147
.getByRole( 'button', { name: 'Styles' } )

0 commit comments

Comments
 (0)