test: cover project link rendering in project-list block
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 file changed
+21
@@ -37,6 +37,27 @@ class ProjectBlocksTest extends WP_UnitTestCase {
|
||||
$this->assertStringContainsString( 'Beta', $markup );
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure stored project links render with their platform icons.
|
||||
*/
|
||||
public function test_project_list_renders_stored_links() {
|
||||
$term_id = self::factory()->term->create(
|
||||
array(
|
||||
'taxonomy' => 'chrnx_project',
|
||||
'name' => 'Matcha CLI',
|
||||
'slug' => 'matcha-cli-test',
|
||||
)
|
||||
);
|
||||
update_term_meta( $term_id, 'chrnx_project_repo', 'https://example.com/repo' );
|
||||
update_term_meta( $term_id, 'chrnx_project_package', 'https://example.com/package' );
|
||||
|
||||
$markup = do_blocks( '<!-- wp:chrnx/project-list /-->' );
|
||||
|
||||
$this->assertStringContainsString( 'chrnx-platform-links', $markup );
|
||||
$this->assertStringContainsString( 'https://example.com/repo', $markup );
|
||||
$this->assertStringContainsString( 'https://example.com/package', $markup );
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure a project without a cover still renders art.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user