Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
justlevine committed Sep 17, 2024
1 parent 039a0d1 commit 92e7ae6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/unit/CoreHeadingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ public function setUp(): void {
'post_status' => 'publish',
]
);

\WPGraphQL::clear_schema();
}

public function tearDown(): void {
parent::tearDown();

wp_delete_post( $this->post_id, true );

\WPGraphQL::clear_schema();
}

public function query(): string {
Expand Down Expand Up @@ -95,8 +99,6 @@ public function test_retrieve_core_heading_attributes() {

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

error_log( print_r( $actual, true ) );

$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 @@ -108,7 +110,6 @@ public function test_retrieve_core_heading_attributes() {
$this->assertEquals( 1, count( $actual['data']['post']['editorBlocks'] ) );

// Verify the block data.
error_log( print_r( $actual['data']['post']['editorBlocks'][0], true ) );
$this->assertNotEmpty( $actual['data']['post']['editorBlocks'][0]['apiVersion'], 'The apiVersion should be present' );
$this->assertEquals( 'text', $actual['data']['post']['editorBlocks'][0]['blockEditorCategoryName'], 'The blockEditorCategoryName should be text' );
$this->assertNotEmpty( $actual['data']['post']['editorBlocks'][0]['clientId'], 'The clientId should be present' );
Expand Down

0 comments on commit 92e7ae6

Please sign in to comment.