fix: preserve progressive CHRNX search
This commit is contained in:
7 files changed
+66
-31
No files matched your search
@@ -72,16 +72,19 @@ class BlockRenderingTest extends WP_UnitTestCase {
|
||||
$this->assertStringContainsString( 'chrnx-screen-reader-text">Buscar</span>', $output );
|
||||
$this->assertStringContainsString( 'data-label-open="Abrir búsqueda"', $output );
|
||||
$this->assertMatchesRegularExpression(
|
||||
'/data-chrnx-search-button[^>]+aria-controls="([^"]+)"[^>]+aria-expanded="false"/',
|
||||
'/data-chrnx-search-button[^>]+aria-controls="([^"]+)"[^>]+aria-expanded="true"/',
|
||||
$output
|
||||
);
|
||||
preg_match( '/data-chrnx-search-button[^>]+aria-controls="([^"]+)"/', $output, $search_control );
|
||||
$this->assertNotEmpty( $search_control[1] );
|
||||
$this->assertSame( 1, substr_count( $output, 'id="' . $search_control[1] . '"' ) );
|
||||
$this->assertMatchesRegularExpression(
|
||||
'/<[^>]+id="' . preg_quote( $search_control[1], '/' ) . '"[^>]+data-chrnx-search-panel/',
|
||||
$output
|
||||
preg_match(
|
||||
'/<[^>]+id="' . preg_quote( $search_control[1], '/' ) . '"[^>]+data-chrnx-search-panel[^>]*>/',
|
||||
$output,
|
||||
$search_panel
|
||||
);
|
||||
$this->assertNotEmpty( $search_panel[0] );
|
||||
$this->assertStringNotContainsString( ' hidden', $search_panel[0] );
|
||||
}
|
||||
|
||||
/** Theme preference keeps native controls behind one translated mobile trigger. */
|
||||
|
||||
Reference in new issue
Block a user