test: cover the new content models and stop duplicate terms

Seeding guarded with term_exists(), which reads a cache that is not
always warm during activation and let a second activation insert
gaming-2, literature-2 and silicon-ranch-2. It asks the taxonomy
directly now, by slug and by name.

Fixtures gain projects and tracks, and the suites follow the assets to
their generated derivatives. Also widens the Site Editor poll, which
threw instead of retrying while the editor was still booting.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
chrnxandClaude Opus 5 committed 2026-08-13 19:42:07 -05:00
1 parent df117e67bb
commit cb491adae6
7 files changed
+125 -30

No files matched your search

+6 -3
View File
@@ -29,7 +29,8 @@ class ResponsiveMediaTest extends WP_UnitTestCase {
$this->assertStringContainsString( 'podcast-frequency-grunge-768.webp 768w', $markup );
$this->assertStringContainsString( 'podcast-frequency-grunge-1536.webp 1536w', $markup );
$this->assertStringContainsString( 'sizes="(max-width: 780px) 100vw, 1200px"', $markup );
$this->assertStringContainsString( 'podcast-frequency-grunge.png', $markup );
$this->assertStringContainsString( 'src="http://', $markup );
$this->assertDoesNotMatchRegularExpression( '#src="[^"]*/assets/images/podcast-frequency-grunge\.png"#', $markup );
$this->assertStringContainsString( 'class="chrnx-character-stage__frequency"', $markup );
$this->assertStringContainsString( 'width="1536"', $markup );
$this->assertStringContainsString( 'height="1024"', $markup );
@@ -43,14 +44,16 @@ class ResponsiveMediaTest extends WP_UnitTestCase {
$this->assertSame( '', chrnx_get_atmosphere_markup( '../../private', 'unsafe class' ) );
}
/** Approved topic portraits render a compact picture element with a PNG fallback. */
/** Approved topic portraits render a compact picture element with a WebP fallback. */
public function test_topic_portrait_picture_markup_has_modern_sources_and_dimensions() {
$markup = chrnx_get_topic_portrait_markup( 'code', 'Code workshop portrait', 'chrnx-section-portrait' );
$this->assertStringContainsString( '<picture', $markup );
$this->assertStringContainsString( 'type="image/avif"', $markup );
$this->assertStringContainsString( 'type="image/webp"', $markup );
$this->assertStringContainsString( 'alter-ego-code.png', $markup );
// The fallback is a generated derivative, never the design master.
$this->assertStringContainsString( 'generated/alter-ego-code-768.webp', $markup );
$this->assertDoesNotMatchRegularExpression( '#src="[^"]*/assets/images/alter-ego-code\.png"#', $markup );
$this->assertStringContainsString( 'width="1122"', $markup );
$this->assertStringContainsString( 'height="1402"', $markup );
$this->assertStringContainsString( 'loading="lazy"', $markup );