Skip to content

Commit

Permalink
Merge pull request #7502 from ampproject/fix/unit-tests
Browse files Browse the repository at this point in the history
Update test cases after Gutenberg 15.4.0 release
  • Loading branch information
westonruter authored Mar 22, 2023
2 parents d6a761e + 12bbe87 commit 44fd13d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/php/test-class-amp-core-block-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ public function test_ampify_gallery_block( $original_block_content, $expected_bl
$expected = preg_replace( '/ data-id="\d+"/', '', $expected );
$actual = preg_replace( '/ data-id="\d+"/', '', $actual );

// Remove `wp-block-gallery-is-layout-flex` class name injected by block editor layout styles.
$actual = preg_replace( '/\s*(?<= class=")?wp-block-gallery-is-layout-flex\s*/', '', $actual );

// Remove `is-layout-flex` class name injected by block editor layout styles.
$actual = preg_replace( '/\s*(?<= class=")?is-layout-flex\s*/', '', $actual );

Expand Down
3 changes: 3 additions & 0 deletions tests/php/validation/test-class-amp-validation-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1393,6 +1393,9 @@ public function test_add_block_source_comments( $content, $expected, $query ) {

$rendered_block = do_blocks( AMP_Validation_Manager::add_block_source_comments( $content ) );

// Remove `wp-block-columns-is-layout-flex` class name injected by block editor layout styles.
$rendered_block = preg_replace( '/\s*(?<= class=")?wp-block-columns-is-layout-flex\s*/', '', $rendered_block );

// Remove `is-layout-flex` class name injected by block editor layout styles.
$rendered_block = preg_replace( '/\s*(?<= class=")?is-layout-flex\s*/', '', $rendered_block );

Expand Down

0 comments on commit 44fd13d

Please sign in to comment.