diff --git a/patterns/music-landing.php b/patterns/music-landing.php index 8589c09..29041ca 100644 --- a/patterns/music-landing.php +++ b/patterns/music-landing.php @@ -13,13 +13,14 @@
- +

+
diff --git a/tests/php/PatternsTest.php b/tests/php/PatternsTest.php index 8489080..6ed3891 100644 --- a/tests/php/PatternsTest.php +++ b/tests/php/PatternsTest.php @@ -215,12 +215,10 @@ class PatternsTest extends WP_UnitTestCase { 'atmosphere' => 'chrnx-character-stage__collage', ), 'music-landing' => array( - 'heading' => 'The No Names', - 'order' => array( 'The No Names', 'Grunge mexicano para cerebros que no se callan.', 'The No Names es una banda activa', 'El proceso usa generative AI' ), - 'art' => 'the-no-names-musician-cutout.png', - 'art_alt' => 'The No Names musician portrait', - 'atmosphere' => 'chrnx-character-stage__collage', - 'atmos_alt' => 'The No Names collage', + 'heading' => 'The No Names', + 'order' => array( 'The No Names', 'Grunge mexicano para cerebros que no se callan.', 'The No Names es una banda activa', 'El proceso usa generative AI' ), + 'art' => 'the-no-names-musician-cutout.png', + 'art_alt' => 'The No Names musician portrait', ), 'podcast-landing' => array( 'heading' => 'Podcasts', @@ -311,6 +309,23 @@ class PatternsTest extends WP_UnitTestCase { } } + /** Meaningful Music collage text remains exposed to assistive technology. */ + public function test_music_landing_meaningful_collage_is_not_hidden_by_the_atmosphere_layer() { + $content = $this->render_pattern( get_theme_file_path( 'patterns/music-landing.php' ) ); + $dom = $this->load_html_fragment( $content ); + $xpath = new DOMXPath( $dom ); + $stage = $xpath->query( '//*[contains(concat(" ", normalize-space(@class), " "), " chrnx-character-stage ")]' )->item( 0 ); + $collage = $xpath->query( '//img[@alt="The No Names collage"]' )->item( 0 ); + + $this->assertInstanceOf( DOMElement::class, $stage ); + $this->assertInstanceOf( DOMElement::class, $collage ); + $this->assertCount( 3, $xpath->query( './*', $stage ) ); + $this->assertCount( 0, $xpath->query( 'ancestor::*[@aria-hidden="true"]', $collage ) ); + $this->assertCount( 1, $xpath->query( 'ancestor::*[contains(concat(" ", normalize-space(@class), " "), " chrnx-character-stage__content ")]', $collage ) ); + $this->assertCount( 0, $xpath->query( './*[contains(concat(" ", normalize-space(@class), " "), " chrnx-character-stage__atmosphere ")]//picture', $stage ) ); + $this->assertCount( 1, $xpath->query( './*[contains(concat(" ", normalize-space(@class), " "), " chrnx-character-stage__art ")]//picture', $stage ) ); + } + /** Rendered pattern content survives parse/serialize without block-tree drift. */ public function test_character_led_patterns_preserve_editor_fidelity() { foreach ( array( 'home-projects', 'home-music', 'music-landing', 'podcast-landing', 'about' ) as $name ) {