-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove redundant calls to disable the Styles welcome guide #50871
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
const { | ||
test, | ||
expect, | ||
Editor, | ||
} = require( '@wordpress/e2e-test-utils-playwright' ); | ||
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); | ||
|
||
test.use( { | ||
editor: async ( { page }, use ) => { | ||
await use( new Editor( { page } ) ); | ||
}, | ||
userGlobalStylesRevisions: async ( { page, requestUtils }, use ) => { | ||
await use( new UserGlobalStylesRevisions( { page, requestUtils } ) ); | ||
}, | ||
|
@@ -29,10 +22,9 @@ test.describe( 'Global styles revisions', () => { | |
await requestUtils.activateTheme( 'twentytwentyone' ); | ||
} ); | ||
|
||
test.beforeEach( async ( { admin } ) => { | ||
await admin.visitSiteEditor( { | ||
canvas: 'edit', | ||
} ); | ||
test.beforeEach( async ( { admin, editor } ) => { | ||
await admin.visitSiteEditor(); | ||
await editor.canvas.click( 'body' ); | ||
Comment on lines
+25
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ramonjd, I wasn't able to run tests locally without this change. However, it's a common pattern, so I don't think there's a need for a separate PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No worries, thanks for the heads up! |
||
} ); | ||
|
||
test( 'should display revisions UI when there is more than 1 revision', async ( { | ||
|
@@ -131,15 +123,6 @@ class UserGlobalStylesRevisions { | |
this.requestUtils = requestUtils; | ||
} | ||
|
||
async disableWelcomeGuide() { | ||
// Turn off the welcome guide. | ||
await this.page.evaluate( () => { | ||
window.wp.data | ||
.dispatch( 'core/preferences' ) | ||
.set( 'core/edit-site', 'welcomeGuideStyles', false ); | ||
} ); | ||
} | ||
|
||
async getGlobalStylesRevisions() { | ||
const stylesPostId = | ||
await this.requestUtils.getCurrentThemeGlobalStylesPostId(); | ||
|
@@ -159,7 +142,6 @@ class UserGlobalStylesRevisions { | |
} | ||
|
||
async openStylesPanel() { | ||
await this.disableWelcomeGuide(); | ||
await this.page | ||
.getByRole( 'region', { name: 'Editor top bar' } ) | ||
.getByRole( 'button', { name: 'Styles' } ) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
editor
is available by default; there's no need for a manul setup.