Skip to content

Commit 44fd13d

Browse files
authored
Merge pull request #7502 from ampproject/fix/unit-tests
Update test cases after Gutenberg 15.4.0 release
2 parents d6a761e + 12bbe87 commit 44fd13d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

tests/php/test-class-amp-core-block-handler.php

+3
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,9 @@ public function test_ampify_gallery_block( $original_block_content, $expected_bl
351351
$expected = preg_replace( '/ data-id="\d+"/', '', $expected );
352352
$actual = preg_replace( '/ data-id="\d+"/', '', $actual );
353353

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

tests/php/validation/test-class-amp-validation-manager.php

+3
Original file line numberDiff line numberDiff line change
@@ -1393,6 +1393,9 @@ public function test_add_block_source_comments( $content, $expected, $query ) {
13931393

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

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

0 commit comments

Comments
 (0)