Skip to content

Commit

Permalink
Add a p tag check test
Browse files Browse the repository at this point in the history
  • Loading branch information
cbravobernal committed Dec 26, 2023
1 parent f5ac832 commit 4843cb7
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<!-- wp:gutenberg/test-context-level-1 --><!-- wp:gutenberg/test-context-read-only /--><!-- wp:paragraph --><p>Welcome</p><!-- /wp:paragraph --><!-- /wp:gutenberg/test-context-level-1 -->';
$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'];
}
Expand Down

0 comments on commit 4843cb7

Please sign in to comment.