fix: preserve progressive CHRNX search

This commit is contained in:
chrnx committed 2026-08-11 19:45:14 -05:00
1 parent 55166c6d2a
commit e7956a1496
7 files changed
+66 -31

No files matched your search

+7 -4
View File
@@ -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. */