A block theme has no PHP for a unit test to call, and the nearest equivalent is rendering the template and asserting on the markup.
public function test_single_template_renders_the_post_content(): void
{
$id = self::factory()->post->create(
array( 'post_content' => '<!-- wp:paragraph --><p>Hi</p><!-- /wp:paragraph -->' )
);
$this->go_to( get_permalink( $id ) );
$html = do_blocks(
file_get_contents( get_theme_file_path( 'templates/single.html' ) )
);
$this->assertStringContainsString( '<p>Hi</p>', $html );
}
go_to sets the global query so the dynamic blocks have something to render, which is the part that makes this work at all. It tests that the template references the right blocks rather than that the page looks correct, which is a narrow assertion and is more than a theme usually has.