refactor: compose CHRNX music and podcast stages

This commit is contained in:
chrnx committed 2026-08-13 01:45:03 -05:00
1 parent 06d2c88b81
commit 9b94eb17c5
8 files changed
+543 -19

No files matched your search

+18
View File
@@ -604,6 +604,24 @@ class BlockRenderingTest extends WP_UnitTestCase {
$this->assertStringNotContainsString( '<iframe', $output );
}
/** Podcast landing owns one dynamic latest block and renders one supporting card. */
public function test_podcast_landing_renders_exactly_one_latest_podcast_card() {
$post_id = self::factory()->post->create( array( 'post_title' => 'One landing conversation' ) );
wp_set_object_terms( $post_id, 'podcasts', 'chrnx_topic' );
wp_set_object_terms( $post_id, 'silicon-ranch', 'chrnx_show' );
ob_start();
include get_theme_file_path( 'patterns/podcast-landing.php' );
$content = (string) ob_get_clean();
$output = do_blocks( $content );
$this->assertSame( 1, substr_count( $content, '<!-- wp:chrnx/latest-podcast /-->' ) );
$this->assertSame( 1, preg_match_all( '/<section\b[^>]*class="[^"]*\bchrnx-latest-podcast\b[^"]*"/', $output ) );
$this->assertSame( 1, substr_count( $output, 'One landing conversation' ) );
$this->assertStringNotContainsString( '<audio', $output );
$this->assertStringNotContainsString( '<iframe', $output );
}
/** Topic hero uses approved decorative art for mapped topics and rejects arbitrary paths. */
public function test_topic_hero_rejects_paths_and_uses_approved_decorative_art() {
$output = render_block(