[wp-trac] [WordPress Trac] #58839: Editor: Add test coverage for context setting in Comment Template block

WordPress Trac noreply at wordpress.org
Tue Jul 18 14:05:49 UTC 2023


#58839: Editor: Add test coverage for context setting in Comment Template block
-----------------------------+-----------------------------
 Reporter:  Bernhard Reiter  |      Owner:  (none)
     Type:  enhancement      |     Status:  new
 Priority:  low              |  Milestone:  Awaiting Review
Component:  Editor           |    Version:
 Severity:  minor            |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 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
 [https://core.trac.wordpress.org/ticket/58699#comment:12 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).

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58839>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list