fix: harden CHRNX theme foundation

This commit is contained in:
chrnx committed 2026-08-11 14:23:35 -05:00
1 parent b727d4148c
commit ab305c98d1
4 files changed
+49 -4

No files matched your search

+34
View File
@@ -25,4 +25,38 @@ class ThemeSetupTest extends WP_UnitTestCase {
public function test_card_image_size_is_registered() {
$this->assertTrue( has_image_size( 'chrnx-card' ) );
}
/**
* Ensure the base stylesheet is available in the editor.
*/
public function test_base_editor_stylesheet_is_registered() {
global $editor_styles;
$this->assertContains( 'assets/css/base.css', $editor_styles );
}
/**
* Ensure the local base stylesheet is enqueued with the theme version.
*/
public function test_base_stylesheet_is_enqueued_locally_with_theme_version() {
wp_dequeue_style( 'chrnx-base' );
wp_deregister_style( 'chrnx-base' );
try {
do_action( 'wp_enqueue_scripts' );
$styles = wp_styles();
$this->assertTrue( wp_style_is( 'chrnx-base', 'enqueued' ) );
$this->assertArrayHasKey( 'chrnx-base', $styles->registered );
$base = $styles->registered['chrnx-base'];
$this->assertSame( get_theme_file_uri( 'assets/css/base.css' ), $base->src );
$this->assertSame( CHRNX_VERSION, $base->ver );
} finally {
wp_dequeue_style( 'chrnx-base' );
wp_deregister_style( 'chrnx-base' );
}
}
}