#58839 closed enhancement (fixed)
Editor: Add test coverage for context setting in Comment Template block
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.3 | Priority: | low |
Severity: | minor | Version: | |
Component: | Editor | Keywords: | has-patch has-unit-tests commit |
Focuses: | Cc: |
Description
In https://github.com/WordPress/gutenberg/pull/50279, the way that commentId
context is set for the Comment Template block was changed: Previously, that context was passed directly as an argument to the WP_Block
constructor, whereas since then, it has been set via the render_block_context
filter. (This was done so that other potential blocks that are inserted programmatically as inner blocks into the Comment Template block would have access to that same block context, which is crucial for their functioning.) This change was later amended by https://github.com/WordPress/gutenberg/pull/50883.
Since the relevant code is a dynamic block's PHP code, it was eventually synced to Core (via the @wordpress/block-library
npm) for WP 6.3 Beta 1.
Test coverage for this new behavior was added to Gutenberg in https://github.com/WordPress/gutenberg/pull/50879, as it became apparent during discussion that it's easily broken.
The block code was amended once again in https://github.com/WordPress/gutenberg/pull/52364, which was then synced to Core (WP 6.3 Beta 4).
In order to guard Core against regressions of the Comment Template block, we should carry over test coverage from https://github.com/WordPress/gutenberg/pull/50879 (and potentially from https://github.com/WordPress/gutenberg/pull/50883, which is related).
Change History (7)
This ticket was mentioned in PR #4507 on WordPress/wordpress-develop by @Bernhard Reiter.
19 months ago
#1
- Keywords has-patch has-unit-tests added
@Bernhard Reiter commented on PR #4507:
19 months ago
#2
Took me a while, but I’ve filed the ticket. I've also addressed everyone's feedback (thank you!)
We're pretty close to RC1, so I'm not sure if folks are comfortable merging this so late in the game. OTOH, it's a test-only change that's supposed to guard against regressions 🤔
@Bernhard Reiter commented on PR #4507:
19 months ago
#3
Added some more coverage in d3e3ffd880 to cover the scenario fixed by https://github.com/WordPress/gutenberg/pull/52364.
cc/ @dlh01
#4
@
19 months ago
- Milestone changed from Awaiting Review to 6.3
- Owner set to Bernhard Reiter
- Status changed from new to accepted
I'll set the Milestone to 6.3 for folks to decide if it's fine to include it in that version.
Quoting https://github.com/WordPress/wordpress-develop/pull/4507#issuecomment-1640361068:
We're pretty close to RC1, so I'm not sure if folks are comfortable merging this so late in
the game. OTOH, it's a test-only change that's supposed to guard against regressions
@Bernhard Reiter commented on PR #4507:
19 months ago
#7
Thanks all! Committed to Core in https://core.trac.wordpress.org/changeset/56262 😊
Backport of https://github.com/WordPress/gutenberg/pull/50879 and https://github.com/WordPress/gutenberg/pull/50883.
Trac ticket: https://core.trac.wordpress.org/ticket/58839