Skip to content

Commit

Permalink
fix: add previously untested inline comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutoshgautams committed Sep 24, 2024
1 parent fbd91cc commit 01d6e25
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions tests/unit/CoreParagraphTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ className
fontSize
gradient
lock
metadata
# metadata
placeholder
style
textColor
Expand Down Expand Up @@ -125,6 +125,7 @@ public function test_retrieve_core_paragraph_attributes() {

$actual = graphql( compact( 'query', 'variables' ) );

$this->assertArrayNotHasKey( 'errors', $actual, 'There should not be any errors' );
$this->assertArrayHasKey( 'data', $actual, 'The data key should be present' );
$this->assertArrayHasKey( 'post', $actual['data'], 'The post key should be present' );

Expand All @@ -146,22 +147,21 @@ public function test_retrieve_core_paragraph_attributes() {
$attributes = $block['attributes'];
$this->assertEquals(
[
'align' => 'center',
'align' => 'center', // previously untested
'anchor' => null,
'backgroundColor' => 'pale-cyan-blue',
'backgroundColor' => 'pale-cyan-blue', // previously untested
'className' => null,
'content' => 'This is a test paragraph with various attributes.',
'cssClassName' => 'has-text-align-center has-vivid-red-color has-pale-cyan-blue-background-color has-text-color has-background has-large-font-size has-helvetica-arial-font-family',
'content' => 'This is a test paragraph with various attributes.', // previously untested
'cssClassName' => 'has-text-align-center has-vivid-red-color has-pale-cyan-blue-background-color has-text-color has-background has-large-font-size has-helvetica-arial-font-family', // previously untested
'dropCap' => false,
'direction' => null,
'fontFamily' => 'helvetica-arial',
'fontSize' => 'large',
'fontFamily' => 'helvetica-arial', // previously untested
'fontSize' => 'large', // previously untested
'gradient' => null,
'lock' => null,
'metadata' => null,
'placeholder' => null,
'style' => null,
'textColor' => 'vivid-red',
'textColor' => 'vivid-red', // previously untested
],
$attributes
);
Expand Down Expand Up @@ -199,6 +199,7 @@ public function test_retrieve_core_paragraph_with_drop_cap_and_custom_styles() {

$actual = graphql( compact( 'query', 'variables' ) );

$this->assertArrayNotHasKey( 'errors', $actual, 'There should not be any errors' );
$this->assertArrayHasKey( 'data', $actual, 'The data key should be present' );
$this->assertArrayHasKey( 'post', $actual['data'], 'The post key should be present' );

Expand All @@ -219,15 +220,14 @@ public function test_retrieve_core_paragraph_with_drop_cap_and_custom_styles() {
'className' => null,
'content' => 'This is a paragraph with drop cap and custom styles.',
'cssClassName' => 'has-drop-cap',
'dropCap' => true,
'dropCap' => true, // previously untested
'direction' => null,
'fontFamily' => null,
'fontSize' => null,
'gradient' => null,
'lock' => null,
'metadata' => null,
'placeholder' => null,
'style' => wp_json_encode(
'style' => wp_json_encode( // previously untested
[
'typography' => [
'lineHeight' => '2',
Expand Down Expand Up @@ -282,6 +282,7 @@ public function test_retrieve_core_paragraph_with_direction_and_gradient() {

$actual = graphql( compact( 'query', 'variables' ) );

$this->assertArrayNotHasKey( 'errors', $actual, 'There should not be any errors' );
$this->assertArrayHasKey( 'data', $actual, 'The data key should be present' );
$this->assertArrayHasKey( 'post', $actual['data'], 'The post key should be present' );

Expand All @@ -303,12 +304,11 @@ public function test_retrieve_core_paragraph_with_direction_and_gradient() {
'content' => 'This is a right-aligned RTL paragraph with a gradient background.',
'cssClassName' => 'has-text-align-right has-vivid-cyan-blue-to-vivid-purple-gradient-background',
'dropCap' => false,
'direction' => 'rtl',
'direction' => 'rtl', // previously untested
'fontFamily' => null,
'fontSize' => null,
'gradient' => 'vivid-cyan-blue-to-vivid-purple',
'gradient' => 'vivid-cyan-blue-to-vivid-purple', // previously untested
'lock' => null,
'metadata' => null,
'placeholder' => null,
'style' => null,
'textColor' => null,
Expand Down Expand Up @@ -350,6 +350,7 @@ public function test_retrieve_core_paragraph_with_additional_attributes() {

$actual = graphql( compact( 'query', 'variables' ) );

$this->assertArrayNotHasKey( 'errors', $actual, 'There should not be any errors' );
$this->assertArrayHasKey( 'data', $actual, 'The data key should be present' );
$this->assertArrayHasKey( 'post', $actual['data'], 'The post key should be present' );

Expand All @@ -365,19 +366,18 @@ public function test_retrieve_core_paragraph_with_additional_attributes() {
$this->assertEquals(
[
'align' => null,
'anchor' => 'test-anchor',
'anchor' => 'test-anchor', // previously untested
'backgroundColor' => null,
'className' => 'custom-class',
'className' => 'custom-class', // previously untested
'content' => 'This is a paragraph with additional attributes.',
'cssClassName' => 'custom-class',
'dropCap' => false,
'direction' => null,
'fontFamily' => null,
'fontSize' => null,
'gradient' => null,
'lock' => '{"move":true,"remove":true}',
'metadata' => '{"someKey":"someValue"}',
'placeholder' => 'Type here...',
'lock' => '{"move":true,"remove":true}', // previously untested
'placeholder' => 'Type here...', // previously untested
'style' => null,
'textColor' => null,
],
Expand Down

0 comments on commit 01d6e25

Please sign in to comment.