Skip to content

Commit

Permalink
Updating classnames for wpGetBlockCssSelector.php tests
Browse files Browse the repository at this point in the history
Reverting changes to Tests_Theme_wpThemeJson that will need to be reinstated after WordPress#4619 merges
  • Loading branch information
ramonjd authored and tellthemachines committed Jun 27, 2023
1 parent 5132c5b commit e2c1297
Showing 1 changed file with 13 additions and 28 deletions.
41 changes: 13 additions & 28 deletions tests/phpunit/tests/theme/wpGetBlockCssSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,6 @@ public function test_get_duotone_selector_via_selectors_api() {
$this->assertEquals( '.duotone-selector', $selector );
}

public function test_get_duotone_selector_via_experimental_property() {
$block_type = self::register_test_block(
'test/experimental-duotone-selector',
null,
array(
'color' => array(
'__experimentalDuotone' => '.experimental-duotone',
),
)
);

$selector = wp_get_block_css_selector( $block_type, 'filters.duotone' );
$this->assertEquals( '.experimental-duotone', $selector );
}

public function test_no_duotone_selector_set() {
$block_type = self::register_test_block(
'test/null-duotone-selector',
Expand Down Expand Up @@ -347,11 +332,11 @@ public function test_editor_only_root_selector() {
'test/editor-only-selectors',
array( 'root' => '.wp-custom-block-class' ),
null,
array( 'root' => '.editor-only.wp-custom-block-class' )
array( 'root' => '.wp-custom-block-class' )
);

$selector = wp_get_block_css_selector( $block_type, 'root' );
$this->assertEquals( '.editor-only.wp-custom-block-class', $selector );
$this->assertEquals( '.wp-custom-block-class', $selector );
}

public function test_editor_only_duotone_selector() {
Expand All @@ -364,12 +349,12 @@ public function test_editor_only_duotone_selector() {
),
null,
array(
'filters' => array( 'duotone' => '.editor-duotone-selector' ),
'filters' => array( 'duotone' => '.duotone-selector' ),
)
);

$selector = wp_get_block_css_selector( $block_type, 'filters.duotone' );
$this->assertEquals( '.editor-duotone-selector', $selector );
$this->assertEquals( '.duotone-selector', $selector );
}

public function test_editor_only_feature_selector() {
Expand All @@ -379,11 +364,11 @@ public function test_editor_only_feature_selector() {
'test/editor-feature-selector',
array( 'typography' => array( 'root' => '.typography' ) ),
null,
array( 'typography' => array( 'root' => '.editor-typography' ) )
array( 'typography' => array( 'root' => '.typography' ) )
);

$selector = wp_get_block_css_selector( $block_type, 'typography' );
$this->assertEquals( '.editor-typography', $selector );
$this->assertEquals( '.typography', $selector );
}

public function test_editor_only_feature_selector_shorthand() {
Expand All @@ -393,11 +378,11 @@ public function test_editor_only_feature_selector_shorthand() {
'test/editor-feature-selector',
array( 'typography' => '.typography' ),
null,
array( 'typography' => '.editor-typography' )
array( 'typography' => '.typography' )
);

$selector = wp_get_block_css_selector( $block_type, 'typography' );
$this->assertEquals( '.editor-typography', $selector );
$this->assertEquals( '.typography', $selector );
}

public function test_editor_only_subfeature_selector() {
Expand All @@ -407,11 +392,11 @@ public function test_editor_only_subfeature_selector() {
'test/editor-subfeature-selector',
array( 'typography' => array( 'fontSize' => '.font-size' ) ),
null,
array( 'typography' => array( 'fontSize' => '.editor-font-size' ) )
array( 'typography' => array( 'fontSize' => '.font-size' ) )
);

$selector = wp_get_block_css_selector( $block_type, 'typography.fontSize' );
$this->assertEquals( '.editor-font-size', $selector );
$this->assertEquals( '.font-size', $selector );
}

public function test_non_editor_subfeature_does_not_fall_back_to_editor_only_feature_selector() {
Expand All @@ -421,7 +406,7 @@ public function test_non_editor_subfeature_does_not_fall_back_to_editor_only_fea
'test/editor-subfeature-selector',
array( 'typography' => array( 'fontSize' => '.font-size' ) ),
null,
array( 'typography' => '.editor-font-size' )
array( 'typography' => '.font-size' )
);

$selector = wp_get_block_css_selector( $block_type, 'typography.fontSize', true );
Expand All @@ -435,11 +420,11 @@ public function test_unspecified_subfeature_falls_back_to_editor_only_feature_se
'test/editor-subfeature-selector',
array( 'typography' => '.typography' ),
null,
array( 'typography' => '.editor-typography' )
array( 'typography' => '.typography' )
);

$selector = wp_get_block_css_selector( $block_type, 'typography.fontSize', true );
$this->assertEquals( '.editor-typography', $selector );
$this->assertEquals( '.typography', $selector );
}
}

0 comments on commit e2c1297

Please sign in to comment.