Skip to content

Commit ece1a4d

Browse files
committed
Added test to check resolution of spacing presets
1 parent 48d279d commit ece1a4d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

phpunit/class-wp-theme-json-test.php

+12-1
Original file line numberDiff line numberDiff line change
@@ -4969,6 +4969,7 @@ public function test_resolve_variables() {
49694969
$raw_color_value = '#efefef';
49704970
$large_font = '18px';
49714971
$small_font = '12px';
4972+
$spacing = 'clamp(1.5rem, 5vw, 2rem)';
49724973
$theme_json = new WP_Theme_JSON_Gutenberg(
49734974
array(
49744975
'version' => WP_Theme_JSON_Gutenberg::LATEST_SCHEMA,
@@ -5008,6 +5009,15 @@ public function test_resolve_variables() {
50085009
),
50095010
),
50105011
),
5012+
'spacing' => array(
5013+
'spacingSizes' => array(
5014+
array(
5015+
'size' => $spacing,
5016+
'name' => '100',
5017+
'slug' => '100',
5018+
),
5019+
),
5020+
),
50115021
),
50125022
'styles' => array(
50135023
'color' => array(
@@ -5077,7 +5087,7 @@ public function test_resolve_variables() {
50775087
),
50785088
'core/columns' => array(
50795089
'spacing' => array(
5080-
'margin' => 'var(--wp--preset--spacing--100)',
5090+
'blockGap' => 'var(--wp--preset--spacing--100)',
50815091
),
50825092
),
50835093
),
@@ -5128,6 +5138,7 @@ public function test_resolve_variables() {
51285138
* WP_Theme_JSON_Resolver_Gutenberg::get_block_data() sets blockGap for supported blocks to `null` if the value is not defined.
51295139
*/
51305140
$this->assertNull( $styles['blocks']['core/post-template']['spacing']['blockGap'], 'core/post-template block: blockGap' );
5141+
$this->assertEquals( $spacing, $styles['blocks']['core/columns']['spacing']['blockGap'], 'core/columns block: blockGap' );
51315142
}
51325143

51335144
/**

0 commit comments

Comments
 (0)