Skip to content
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

DB-6671: Preview Button Regression in WordPress 6.3 #58

Merged
merged 1 commit into from Aug 23, 2023

Conversation

backlineint
Copy link
Contributor

In WordPress 6.3 dispatching an autosave event in the block editor via JS now triggers additional actions by WordPress that expect the default preview button to exist. This was causing React to throw an exception in the block editor.

In order to resolve this, we're now hiding the standard preview button with CSS rather than removing it from the dom via JS.

I also took a long look at adding test coverage for this. Since this functionality depends on client side JS our existing suite of PHP unit tests won't help. From what I can tell, WordPress does not have a core solution for functional or browser tests. The only JS testing is JQuery unit testing, which I also don't think can cover this use case. wp-browser (https://wpbrowser.wptestkit.dev/) seems like it would meet our needs, but the implementation would be outside the scope of this ticket. wp-browser uses codeception rather than phpunit, and assumes that a live WordPress environment already exists.

We have an upcoming need for End to End testing, so I think that would be the most efficient way to address this.

Long term:

  • We could take on the effort to implement browser based testing.
  • or refactor the plugin to handle more of these changes on the server side. Our client side approach has proven to be brittle.

@backlineint backlineint requested review from a team as code owners August 18, 2023 21:39
Copy link
Member

@CobyPear CobyPear left a comment

Choose a reason for hiding this comment

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

Tested with our dev sandbox by using the DB-6671 branch and it LGTM

@CobyPear CobyPear merged commit 0046de1 into pantheon-systems:develop Aug 23, 2023
1 check passed
@pwtyler
Copy link
Member

pwtyler commented Aug 23, 2023

@CobyPear @backlineint should "Tested up To" be incremented again?

@backlineint backlineint deleted the DB-6671 branch August 23, 2023 19:26
@backlineint
Copy link
Contributor Author

Yup - sorry that slipped my mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants