Skip to content

e2e-commons: match editor panel name exactly to unblock post-editor e2e#49107

Merged
CGastrell merged 1 commit into
trunkfrom
fix/e2e-commons-jetpack-panel-exact-match
May 22, 2026
Merged

e2e-commons: match editor panel name exactly to unblock post-editor e2e#49107
CGastrell merged 1 commit into
trunkfrom
fix/e2e-commons-jetpack-panel-exact-match

Conversation

@CGastrell
Copy link
Copy Markdown
Contributor

Fixes the strict-mode violation currently breaking the Jetpack post editor e2e tests check on every PR (e.g. #49099, #49100, #49104).

Proposed changes

  • In tools/e2e-commons/pages/editor-page.ts, the openSettings() helper opens the editor's More menu and looks up the target panel toggle with getByRole( 'menuitemcheckbox', { name: target } ). Playwright's name does a substring match by default, so openSettings( 'Jetpack' ) resolves to both the "Jetpack" panel and the "Jetpack Newsletter" panel (registered at extensions/blocks/subscriptions/menu.js:42).
  • Result: strict-mode violation → sidebar-social.test.ts fails before it can even open the sidebar.
  • Fix: pass exact: true so the matcher requires name === target.

Why this only started failing now

The Newsletter panel has existed since #47857 (March), but it's only visible when the subscriptions module is active. #49034 (merged 2026-05-22 14:42 UTC) flipped subscriptions on by default, which is when the Jetpack post editor e2e job started failing on every subsequent PR.

Timeline:

Testing instructions

Does this pull request change what data or activity we track or use?

No.

The `openSettings` helper used `getByRole( 'menuitemcheckbox', { name: target } )`,
which does a substring match. After #49034 enabled the subscriptions module by
default, the editor More menu now exposes both "Jetpack" and "Jetpack Newsletter"
panels, so `openSettings( 'Jetpack' )` matches two elements and Playwright throws
a strict-mode violation. Adding `exact: true` restores the original single-match
behavior.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 22, 2026

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label May 22, 2026
@CGastrell CGastrell self-assigned this May 22, 2026
@CGastrell CGastrell added [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels May 22, 2026
@CGastrell CGastrell merged commit 52b3321 into trunk May 22, 2026
94 checks passed
@CGastrell CGastrell deleted the fix/e2e-commons-jetpack-panel-exact-match branch May 22, 2026 19:58
@github-actions github-actions Bot removed the [Status] Needs Review This PR is ready for review. label May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant