Repository navigation
Block Bindings: Add unit tests for the list-item content-binding shim - #79854
cbravobernal wants to merge 1 commit into
Conversation
The gutenberg_restore_list_item_inner_blocks_after_binding shim (WP 7.1 compat, added in #78947/#79346) merged without unit tests. Pin its two behaviors: restoring the nested inner blocks when the content binding wipes the whole <li> on WP 6.9/7.0, and rendering them exactly once on cores where WP_Block::replace_html() already preserves them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Closing this as unnecessary. The compat shim behavior is already covered by the existing list-item block bindings tests in The shim itself still remains needed while Gutenberg supports WordPress versions where |
What?
Adds unit tests for
gutenberg_restore_list_item_inner_blocks_after_binding, the WordPress 7.1 compat shim that restores a List Item's nested inner blocks after acontentbinding replaces the whole<li>.Why?
The shim landed in #78947 / #79346 without unit tests. Extracted from #79852 to keep that PR focused on the innerBlocks binding mechanism.
How?
Two tests pinning the shim's behaviors:
WP_Block::replace_html()lacks the inner-blocks fix (wordpress-develop#12113) and the content binding wipes the whole<li>inner HTML, the shim re-appends the instance's rendered inner blocks (called directly with the wiped state those cores produce).render_block(): a content-bound List Item keeps its nested list, rendered exactly once (thestr_containsguard prevents a double-append on fixed cores).Testing Instructions
🤖 Generated with Claude Code