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

Ensure the publish/save button isn't disabled before clicking on it #116

Merged
merged 2 commits into from
Feb 6, 2024

Conversation

dkotter
Copy link
Collaborator

@dkotter dkotter commented Jan 31, 2024

Description of the Change

As described in #115, the classicCreatePost command can sometimes fail if autosaving takes too long. When an autosave happens, WordPress adds the disabled class to the publish button. Once autosave is done, that class is removed. But if our test runs quicker than the autosave, we try clicking the button and nothing happens and our test then fails because the savePost alias never fires.

This PR attempts to fix that by ensuring this button does not have the disabled class before we try clicking it

Closes #115

How to test the Change

Run a test that uses the classicCreatePost command and ensure it works as expected

Changelog Entry

Fixed - Ensure the publish button isn't disabled before we click it in the classicCreatePost command

Credits

Props @dkotter

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@dkotter dkotter added this to the 0.3.0 milestone Jan 31, 2024
@dkotter dkotter self-assigned this Jan 31, 2024
@dkotter dkotter requested a review from a team as a code owner January 31, 2024 18:18
@dkotter dkotter requested review from faisal-alvi and removed request for a team January 31, 2024 18:18
Copy link
Member

@faisal-alvi faisal-alvi left a comment

Choose a reason for hiding this comment

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

Thank you for the efforts @dkotter!

LGTM. I've conducted another round of testing on the PR in the forked repository, and classic-create-post.test.js is also passing there.

However, it's worth noting that a few other tests (for WP latest and WP trunk) are failing in both PRs. These failures seem unrelated to the current PR and already failing in the develop branch too, so I assume we can proceed with merging this one first and worry about the others later.

@dkotter dkotter merged commit 80fed4e into develop Feb 6, 2024
5 of 7 checks passed
@dkotter dkotter deleted the fix/115 branch February 6, 2024 17:24
github-actions bot pushed a commit that referenced this pull request Feb 6, 2024
Ensure the publish/save button isn't disabled before clicking on it
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.

classicCreatePost can fail if autosave takes too long
2 participants