From 4843cb7ff8a0f4f9ec073e3a3163d85d6b8c007b Mon Sep 17 00:00:00 2001 From: Carlos Bravo Date: Fri, 22 Dec 2023 13:18:48 +0100 Subject: [PATCH] Add a p tag check test --- .../directive-processing-test.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/phpunit/experimental/interactivity-api/directive-processing-test.php b/phpunit/experimental/interactivity-api/directive-processing-test.php index 655dc1ab03022f..0dafc3c8a58970 100644 --- a/phpunit/experimental/interactivity-api/directive-processing-test.php +++ b/phpunit/experimental/interactivity-api/directive-processing-test.php @@ -135,6 +135,23 @@ public function test_directives_are_processed_at_tag_end() { $this->assertSame( 'level-1', $value ); } + public function test_non_interactive_children_of_interactive_is_rendered() { + $post_content = '

Welcome

'; + $rendered_blocks = do_blocks( $post_content ); + $p = new WP_HTML_Tag_Processor( $rendered_blocks ); + $p->next_tag( array( 'class_name' => 'level-1-input-1' ) ); + $value = $p->get_attribute( 'value' ); + $this->assertSame( 'level-1', $value ); + $p->next_tag( array( 'class_name' => 'read-only-input-1' ) ); + $value = $p->get_attribute( 'value' ); + $this->assertSame( 'level-1', $value ); + $p->next_tag(); + $this->assertSame( 'P', $p->get_tag() ); + $p->next_tag( array( 'class_name' => 'level-1-input-2' ) ); + $value = $p->get_attribute( 'value' ); + $this->assertSame( 'level-1', $value ); + } + public function increment( $store ) { return $store['state']['count'] + $store['context']['count']; }