Fix failing E2E tests for PR #4061#4088
Merged
Merged
Conversation
Co-authored-by: acicovic <23142906+acicovic@users.noreply.github.com> Agent-Logs-Url: https://github.com/Parsely/wp-parsely/sessions/fcbc58e6-481a-443e-adbd-e0d0b67d1fd5
Contributor
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Copilot
AI
changed the title
[WIP] Fix apiVersion number mismatch
Fix apiVersion number mismatch
Mar 23, 2026
acicovic
approved these changes
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes a mismatch where
blocks/recommendations/edit.tsxdeclaredapiVersion: 2in itsregisterBlockTypecall whileblock.jsondeclaredapiVersion: 3. Updatesedit.tsxto3and fixes E2E tests that broke as a result.Block fix:
src/blocks/recommendations/edit.tsx:apiVersion: 2→3inregisterBlockTypeE2E test fix:
apiVersion: 3inregisterBlockTypecauses WordPress to render the editor canvas inside an[name="editor-canvas"]iframe (vs. the non-iframed legacy canvas used withapiVersion: 2). Tests that usedpage.locator()/page.getByText()to query block-rendered elements were failing because those elements are now scoped to the iframe.errors.spec.ts:page.getByText()→admin.editor.canvas.getByText()for error messages rendered inside the blocksettings.spec.ts:page.locator()→editor.canvas.locator()for block content selectors; sidebar elements (labels, sliders) remain onpage;Utilsclass updated to acceptFrameLocatorinstead ofPageMotivation and context
Mismatched
apiVersionvalues are a latent bug: the effective API version is controlled byregisterBlockType, notblock.json, so the block was silently running as v2 despite the metadata claiming v3. Aligning them to v3 changes the editor rendering path (iframed canvas), which the E2E tests must account for.How has this been tested?
Existing E2E tests updated to work with the iframed editor canvas introduced by
apiVersion: 3.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.