Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Add tests for CoreHeading block #10

Merged
merged 14 commits into from
Sep 26, 2024
Merged
22 changes: 11 additions & 11 deletions tests/unit/CoreHeadingTest.php
justlevine marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function test_retrieve_core_heading_with_colors_and_alignment() {
[
'align' => 'wide', // Previously untested
'anchor' => null,
'backgroundColor' => null,
'backgroundColor' => null, // @todo: This is not returning correctly.
'className' => null,
'content' => 'Colored Heading',
'cssClassName' => 'wp-block-heading has-text-align-right has-text-color has-background alignwide',
Expand All @@ -193,7 +193,7 @@ public function test_retrieve_core_heading_with_colors_and_alignment() {
],
]),
'textAlign' => 'right',
'textColor' => null,
'textColor' => null, // @todo: This is not returning correctly.
],
$attributes
);
Expand Down Expand Up @@ -226,21 +226,21 @@ public function test_retrieve_core_heading_with_font_and_anchor() {
$this->assertEquals(
[
'align' => null,
'anchor' => 'custom-id',
'anchor' => 'custom-id', // Previously untested
'backgroundColor' => null,
'className' => null,
'content' => 'Custom Font Heading',
'cssClassName' => 'wp-block-heading',
'fontFamily' => null, // Previously untested
'fontSize' => null,
'fontFamily' => null, // @todo: This is not returning correctly.
'fontSize' => null, // @todo: This is not returning correctly.
justlevine marked this conversation as resolved.
Show resolved Hide resolved
'gradient' => null,
'level' => 2.0,
'lock' => null,
'placeholder' => null,
'style' => wp_json_encode([
'typography' => [
'fontFamily' => 'Arial',
'fontSize' => '32px',
'fontFamily' => 'Arial', // Previously untested
'fontSize' => '32px', // Previously untested
],
]),
'textAlign' => null,
Expand Down Expand Up @@ -284,7 +284,7 @@ public function test_retrieve_core_heading_with_gradient() {
'cssClassName' => 'wp-block-heading has-background',
'fontFamily' => null,
'fontSize' => null,
'gradient' => null, // Previously untested
'gradient' => null, // @todo: This is not returning correctly.
'level' => 2.0,
'lock' => null,
'placeholder' => null,
Expand Down Expand Up @@ -386,7 +386,7 @@ public function test_retrieve_core_heading_with_text_color() {
'placeholder' => null,
'style' => null,
'textAlign' => null,
'textColor' => 'vivid-red',
'textColor' => 'vivid-red', // Previously untested
],
$attributes
);
Expand Down Expand Up @@ -425,7 +425,7 @@ public function test_retrieve_core_heading_with_font_size() {
'content' => 'Heading with Font Size',
'cssClassName' => 'wp-block-heading has-large-font-size',
'fontFamily' => null,
'fontSize' => 'large',
'fontSize' => 'large', // Previously untested
'gradient' => null,
'level' => 2.0,
'lock' => null,
Expand Down Expand Up @@ -467,7 +467,7 @@ public function test_retrieve_core_heading_with_class_name() {
'align' => null,
'anchor' => null,
'backgroundColor' => null,
'className' => 'custom-class',
'className' => 'custom-class', // Previously untested
'content' => 'Heading with Custom Class',
'cssClassName' => 'wp-block-heading custom-class',
'fontFamily' => null,
Expand Down