Skip to content

Playwright Utils: Use 'set' to disable the Styles welcome guide - #50852

Merged
talldan merged 1 commit into
trunkfrom
fix/visit-site-disable-styles-welcome
May 23, 2023
Merged

talldan merged 1 commit into
trunkfrom
fix/visit-site-disable-styles-welcome

Conversation

@Mamaduka

Copy link
Copy Markdown
Member

What?

Resolves #49942

PR updates the visitSiteEditor utility method to use the set action to disable the Styles welcome guide.

Why?

The toggle action doesn't accept value as an argument and can sometimes enable the welcome guide modal.

Testing Instructions

  1. Add a new test to the "Push to Global Styles button". See the code below.
  2. Running the test on the trunk will fail, but will pass on this branch.
npm run test:e2e:playwright -- test/e2e/specs/site-editor/push-to-global-styles.spec.js
test( 'should apply condition', async ( { page } ) => {
        // Turn off the welcome guide.
        await page.evaluate( () => {
            window.wp.data
                .dispatch( 'core/preferences' )
                .set( 'core/edit-site', 'welcomeGuideStyles', false );
        } );
} );

@Mamaduka
Mamaduka requested a review from kevin940726 as a code owner May 22, 2023 18:47
@Mamaduka
Mamaduka requested a review from talldan May 22, 2023 18:47
@Mamaduka Mamaduka self-assigned this May 22, 2023
@Mamaduka Mamaduka added the [Type] Bug An existing feature does not function as intended label May 22, 2023
@github-actions

Copy link
Copy Markdown

Flaky tests detected in b031284.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5049332804
📝 Reported issues:

@talldan talldan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. It's weird that it's not set already, but looks like it was my mistake 😄

@talldan
talldan merged commit 4b2388e into trunk May 23, 2023
@talldan
talldan deleted the fix/visit-site-disable-styles-welcome branch May 23, 2023 05:29
@github-actions github-actions Bot added this to the Gutenberg 15.9 milestone May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Flaky Test] should apply Heading block styles to all Heading blocks

2 participants