Skip to content

Refactor bootstrap.js for E2E #10860

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

Merged
merged 5 commits into from
Jun 11, 2025

Conversation

ankitrox
Copy link
Collaborator

@ankitrox ankitrox commented Jun 2, 2025

Summary

Addresses issue:

Relevant technical choices

PR Author Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 5.2 and PHP 7.4.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

Do not alter or remove anything below. The following sections will be managed by moderators only.

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.
  • Ensure there are no unexpected significant changes to file sizes.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

@ankitrox ankitrox changed the title Refactor bootstrap.js for E2E. Refactor bootstrap.js for E2E Jun 2, 2025
Copy link
Collaborator

@techanvil techanvil left a comment

Choose a reason for hiding this comment

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

Thanks @ankitrox, this is looking good - it just needs a number of inline comments to be restored or fixed. Please see my comments on the PR for details.

// Before every test suite run, delete all content created by the test. This ensures
// other posts/comments/etc. aren't dirtying tests and tests don't depend on
// each other's side-effects.
// Before every test suite run, delete all content created by the test.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please restore the full comment here.

@@ -364,25 +382,21 @@ async function observeRestResponse( res ) {
if ( res.url().match( 'wp-json' ) ) {
const data = [ res.status(), res.request().method(), res.url() ];

// The response may fail to resolve if the test ends before it completes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please restore this comment.

// At this point, any unexpected message will result in a test failure.

// Check if it's raised by the AMP plugin.
// Check if it's raised by the AMP plugin
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please restore the removed/modified comment here.

// removed once the associated ticket has been closed.
//
// See: https://core.trac.wordpress.org/ticket/47183
// Check if the message should be ignored
Copy link
Collaborator

Choose a reason for hiding this comment

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

This comment should end in a full stop:

Suggested change
// Check if the message should be ignored
// Check if the message should be ignored.

* Array of console messages to ignore.
*/
const IGNORE_CONSOLE_MESSAGES = [
// An exception is made for _blanket_ deprecation warnings
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please restore the full comment for this check, as illustrated below.

There are other checks which have also had their comments truncated or modified as part of this refactor. Please review all of the checks, and restore their full comments.

Suggested change
// An exception is made for _blanket_ deprecation warnings
// An exception is made for _blanket_ deprecation warnings: Those
// which log regardless of whether a deprecated feature is in use.

@ankitrox
Copy link
Collaborator Author

Thank you @techanvil for looking into the code review. I have addressed the comments regarding comments restoration and also restored at some other places where those were missing.

Assigning this to you to review the changes.

Thanks again!

Copy link
Collaborator

@techanvil techanvil left a comment

Choose a reason for hiding this comment

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

LGTM, nice one @ankitrox!

@techanvil techanvil merged commit 7f691ea into develop Jun 11, 2025
10 of 12 checks passed
@techanvil techanvil deleted the enhancement/10369-refactor-bootstrap-js branch June 11, 2025 08:34
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.

2 participants