Repository navigation
Commit 0c51a15
committed
Correct the TinyMCE-initialization fix: the real bug was a wrong button-name selector.
The previous commit ported `WordPress#78631`'s TinyMCE
initialization wait, on the assumption the failure was a race between
the meta box's TinyMCE iframe appearing and the editor finishing
initialization. Verified against real CI, that fix did not resolve the
failure: it still timed out at the same
`role=button[name="Code"i]` click, now after the added
`waitForFunction` had already resolved successfully.
The actual cause is a button-label mismatch, unrelated to any timing
race. The "Code"/"Text" toggle is rendered by WordPress Core's
`wp_editor()` (`wp-includes/class-wp-editor.php`), and `wp-env`'s
pinned core for this branch, `WordPress/WordPress#6.7-branch`, still
ships the string `_x( 'Text', 'Name for the Text editor tab (formerly
HTML)' )`. Core renamed this label to "Code" only on its own `master`
branch (`_x( 'Code', 'Name for the Code editor tab (formerly Text)' )`)
after `6.7-branch` was cut, and never backported the wording change to
the maintenance branch. Screenshots from every failed run (the original
cited run and the one testing the previous, ineffective commit) confirm
the rendered button reads "Text", not "Code". The underlying behavior
is identical either way, so using the correct label is a like-for-like
change, not a weakened assertion.
The Gutenberg plugin's own trunk renamed this locator from "Text" to
"Code" in `WordPress#68872`/`WordPress#68886` (Jan 2025), correctly
following its own trunk's newer bundled/tested core. That rename
doesn't apply on `wp/6.7`, whose `wp-env` config intentionally pins to
the matching `6.7-branch` core, so this reverts the locator back to
"Text" for this branch and drops the TinyMCE-`waitForFunction` addition
along with it, since the original iframe-existence wait was never the
actual problem: the failure was 100% reproducible, not intermittent,
which is what a hard-coded wrong locator produces and a genuine race
condition would not.1 parent 61a8bab commit 0c51a15
1 file changed
Lines changed: 6 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
34 | 31 | | |
35 | | - | |
36 | | - | |
| 32 | + | |
37 | 33 | | |
38 | 34 | | |
39 | 35 | | |
40 | | - | |
| 36 | + | |
41 | 37 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | 38 | | |
46 | 39 | | |
47 | 40 | | |
| |||
0 commit comments