Skip to content

Commit d7caead

Browse files
authored
Merge branch 'WordPress:trunk' into trunk
2 parents 44e0b6f + 13488fa commit d7caead

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

tests/phpunit/tests/block-supports/wpRenderElementsSupportStyles.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public function tear_down() {
2222
*
2323
* @ticket 59555
2424
* @ticket 60557
25+
* @ticket 65538
2526
*
2627
* @covers ::wp_render_elements_support_styles
2728
*
@@ -185,6 +186,22 @@ public function data_elements_block_support_styles() {
185186
),
186187
'expected_styles' => '/^.wp-elements-\d+ .wp-element-button, .wp-elements-\d+ .wp-block-button__link' . $color_css_rules . '$/',
187188
),
189+
'button hover styles are skipped without a hover selector' => array(
190+
'color_settings' => array( 'button' => true ),
191+
'elements_styles' => array(
192+
'button' => array(
193+
'color' => $color_styles,
194+
':hover' => array( 'color' => $color_styles ),
195+
),
196+
),
197+
198+
/*
199+
* Only the base button rule should be emitted. The button element
200+
* type has no `hover_selector`, so the `:hover` object must be
201+
* ignored rather than triggering an undefined array key warning.
202+
*/
203+
'expected_styles' => '/^.wp-elements-\d+ .wp-element-button, .wp-elements-\d+ .wp-block-button__link' . $color_css_rules . '$/',
204+
),
188205
'link element styles are applied' => array(
189206
'color_settings' => array( 'link' => true ),
190207
'elements_styles' => array(

0 commit comments

Comments
 (0)