feat: list every project with its status and links

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
chrnxandClaude Opus 5 committed 2026-08-15 14:12:38 -05:00
1 parent 873842b2a0
commit 54e3e8ccc0
4 files changed
+119 -1

No files matched your search

+55
View File
@@ -0,0 +1,55 @@
<?php
/**
* Tests for the project blocks.
*
* @package CHRNX
*/
/**
* Verify project block rendering.
*/
class ProjectBlocksTest extends WP_UnitTestCase {
/**
* Register blocks and taxonomies before each test.
*/
public function set_up() {
parent::set_up();
do_action( 'init' );
}
/**
* Ensure the list renders one card per project with its status.
*/
public function test_project_list_renders_a_card_per_project() {
$term_id = self::factory()->term->create(
array(
'taxonomy' => 'chrnx_project',
'name' => 'Green Tea',
'slug' => 'green-tea-test',
)
);
update_term_meta( $term_id, 'chrnx_project_status', 'Beta' );
$markup = do_blocks( '<!-- wp:chrnx/project-list /-->' );
$this->assertStringContainsString( 'chrnx-project-card', $markup );
$this->assertStringContainsString( 'Green Tea', $markup );
$this->assertStringContainsString( 'Beta', $markup );
}
/**
* Ensure a project without a cover still renders art.
*/
public function test_project_without_cover_uses_placeholder_art() {
self::factory()->term->create(
array(
'taxonomy' => 'chrnx_project',
'slug' => 'coverless-test',
)
);
$markup = do_blocks( '<!-- wp:chrnx/project-list /-->' );
$this->assertStringContainsString( 'chrnx-project-card__fallback', $markup );
}
}