Skip to content

Commit

Permalink
Add test_switching_themes_recalculates_stylesheet
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Dec 13, 2022
1 parent 45969f1 commit ef450b6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/phpunit/tests/theme/wpGetGlobalStylesheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,12 @@ public function test_should_enqueue_stored_styles() {
'Registered styles with handle of "wp-style-engine-my-styles" do not match expected value from the Style Engine store.'
);
}

public function test_switching_themes_recalculates_stylesheet() {
$stylesheet_for_default_theme = wp_get_global_stylesheet();
switch_theme( 'block-theme' );
$stylesheet_for_block_theme = wp_get_global_stylesheet();
$this->assertStringNotContainsString( '--wp--preset--font-size--custom: 100px;', $stylesheet_for_default_theme, 'custom font size (100px) not present for default theme' );
$this->assertStringContainsString( '--wp--preset--font-size--custom: 100px;', $stylesheet_for_block_theme, 'custom font size (100px) is present for block theme' );
}
}

0 comments on commit ef450b6

Please sign in to comment.