Skip to content

Commit

Permalink
fix failing tests - styles are optimized
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Aug 2, 2022
1 parent b25fc9d commit e8c7e0b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 35 deletions.
16 changes: 8 additions & 8 deletions phpunit/block-supports/border-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function test_border_color_slug_with_numbers_is_kebab_cased_properly() {
$actual = gutenberg_apply_border_support( $block_type, $block_atts );
$expected = array(
'class' => 'has-border-color has-red-border-color',
'style' => 'border-radius: 10px; border-style: dashed; border-width: 1px;',
'style' => 'border-radius:10px;border-style:dashed;border-width:1px;',
);

$this->assertSame( $expected, $actual );
Expand Down Expand Up @@ -179,7 +179,7 @@ function test_flat_border_with_individual_skipped_serialization() {

$actual = gutenberg_apply_border_support( $block_type, $block_atts );
$expected = array(
'style' => 'border-style: dotted; border-width: 1px;',
'style' => 'border-style:dotted;border-width:1px;',
);

$this->assertSame( $expected, $actual );
Expand Down Expand Up @@ -208,7 +208,7 @@ function test_split_border_radius() {
);
$actual = gutenberg_apply_border_support( $block_type, $block_attrs );
$expected = array(
'style' => 'border-top-left-radius: 1em; border-top-right-radius: 2rem; border-bottom-left-radius: 30px; border-bottom-right-radius: 4vh;',
'style' => 'border-top-left-radius:1em;border-top-right-radius:2rem;border-bottom-left-radius:30px;border-bottom-right-radius:4vh;',
);

$this->assertSame( $expected, $actual );
Expand Down Expand Up @@ -237,7 +237,7 @@ function test_flat_border_with_custom_color() {
$actual = gutenberg_apply_border_support( $block_type, $block_attrs );
$expected = array(
'class' => 'has-border-color',
'style' => 'border-color: #72aee6; border-style: dashed; border-width: 2px;',
'style' => 'border-color:#72aee6;border-style:dashed;border-width:2px;',
);

$this->assertSame( $expected, $actual );
Expand Down Expand Up @@ -282,7 +282,7 @@ function test_split_borders_with_custom_colors() {
);
$actual = gutenberg_apply_border_support( $block_type, $block_attrs );
$expected = array(
'style' => 'border-top-width: 2px; border-top-color: #72aee6; border-top-style: dashed; border-right-width: 0.25rem; border-right-color: #e65054; border-right-style: dotted; border-bottom-width: 0.5em; border-bottom-color: #007017; border-bottom-style: solid; border-left-width: 1px; border-left-color: #f6f7f7; border-left-style: solid;',
'style' => 'border-top-width:2px;border-top-color:#72aee6;border-top-style:dashed;border-right-width:0.25rem;border-right-color:#e65054;border-right-style:dotted;border-bottom-width:0.5em;border-bottom-color:#007017;border-bottom-style:solid;border-left-width:1px;border-left-color:#f6f7f7;border-left-style:solid;',
);

$this->assertSame( $expected, $actual );
Expand Down Expand Up @@ -372,7 +372,7 @@ function test_split_borders_with_skipped_individual_feature_serialization() {
);
$actual = gutenberg_apply_border_support( $block_type, $block_attrs );
$expected = array(
'style' => 'border-top-color: #72aee6; border-right-color: #e65054; border-bottom-color: #007017; border-left-color: #f6f7f7;',
'style' => 'border-top-color:#72aee6;border-right-color:#e65054;border-bottom-color:#007017;border-left-color:#f6f7f7;',
);

$this->assertSame( $expected, $actual );
Expand Down Expand Up @@ -409,7 +409,7 @@ function test_partial_split_borders() {
);
$actual = gutenberg_apply_border_support( $block_type, $block_attrs );
$expected = array(
'style' => 'border-top-width: 2px; border-top-color: #72aee6; border-top-style: dashed; border-right-width: 0.25rem; border-right-color: #e65054; border-left-style: solid;',
'style' => 'border-top-width:2px;border-top-color:#72aee6;border-top-style:dashed;border-right-width:0.25rem;border-right-color:#e65054;border-left-style:solid;',
);

$this->assertSame( $expected, $actual );
Expand Down Expand Up @@ -454,7 +454,7 @@ function test_split_borders_with_named_colors() {
);
$actual = gutenberg_apply_border_support( $block_type, $block_attrs );
$expected = array(
'style' => 'border-top-width: 2px; border-top-color: var(--wp--preset--color--red); border-top-style: dashed; border-right-width: 0.25rem; border-right-color: var(--wp--preset--color--green); border-right-style: dotted; border-bottom-width: 0.5em; border-bottom-color: var(--wp--preset--color--blue); border-bottom-style: solid; border-left-width: 1px; border-left-color: var(--wp--preset--color--yellow); border-left-style: solid;',
'style' => 'border-top-width:2px;border-top-color:var(--wp--preset--color--red);border-top-style:dashed;border-right-width:0.25rem;border-right-color:var(--wp--preset--color--green);border-right-style:dotted;border-bottom-width:0.5em;border-bottom-color:var(--wp--preset--color--blue);border-bottom-style:solid;border-left-width:1px;border-left-color:var(--wp--preset--color--yellow);border-left-style:solid;',
);

$this->assertSame( $expected, $actual );
Expand Down
2 changes: 1 addition & 1 deletion phpunit/block-supports/colors-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function test_gradient_with_individual_skipped_serialization_block_supports() {
$actual = gutenberg_apply_colors_support( $block_type, $block_atts );
$expected = array(
'class' => 'has-text-color',
'style' => 'color: #d92828;',
'style' => 'color:#d92828;',
);

$this->assertSame( $expected, $actual );
Expand Down
4 changes: 2 additions & 2 deletions phpunit/block-supports/spacing-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function test_spacing_style_is_applied() {

$actual = gutenberg_apply_spacing_support( $block_type, $block_atts );
$expected = array(
'style' => 'padding: 111px; margin-top: 1px; margin-right: 2px; margin-bottom: 3px; margin-left: 4px;',
'style' => 'padding:111px;margin-top:1px;margin-right:2px;margin-bottom:3px;margin-left:4px;',
);

$this->assertSame( $expected, $actual );
Expand Down Expand Up @@ -152,7 +152,7 @@ function test_margin_with_individual_skipped_serialization_block_supports() {

$actual = gutenberg_apply_spacing_support( $block_type, $block_atts );
$expected = array(
'style' => 'padding-top: 1px; padding-right: 2px; padding-bottom: 3px; padding-left: 4px;',
'style' => 'padding-top:1px;padding-right:2px;padding-bottom:3px;padding-left:4px;',
);

$this->assertSame( $expected, $actual );
Expand Down
4 changes: 2 additions & 2 deletions phpunit/block-supports/typography-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function test_font_family_with_legacy_inline_styles_using_a_value() {
$block_atts = array( 'style' => array( 'typography' => array( 'fontFamily' => 'serif' ) ) );

$actual = gutenberg_apply_typography_support( $block_type, $block_atts );
$expected = array( 'style' => 'font-family: serif;' );
$expected = array( 'style' => 'font-family:serif;' );

$this->assertSame( $expected, $actual );
}
Expand Down Expand Up @@ -175,7 +175,7 @@ function test_font_family_with_legacy_inline_styles_using_a_css_var() {
$block_atts = array( 'style' => array( 'typography' => array( 'fontFamily' => 'var:preset|font-family|h1' ) ) );

$actual = gutenberg_apply_typography_support( $block_type, $block_atts );
$expected = array( 'style' => 'font-family: var(--wp--preset--font-family--h-1);' );
$expected = array( 'style' => 'font-family:var(--wp--preset--font-family--h-1);' );

$this->assertSame( $expected, $actual );
}
Expand Down
Loading

0 comments on commit e8c7e0b

Please sign in to comment.