Skip to content

Commit

Permalink
Tests only
Browse files Browse the repository at this point in the history
  • Loading branch information
dbosen committed Nov 21, 2023
1 parent 351f660 commit 844b639
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,8 @@ protected function resolveBaseFields(string $type, string $entity_type_id): void
$this->addFieldResolverIfNotExists(
$type,
'name',
$this->builder->compose(
$this->builder->produce('entity_label')
->map('entity', $this->builder->fromParent()),
$this->builder->callback(function ($parent) {
return $parent ?: '';
})
)
$this->builder->produce('entity_label')
->map('entity', $this->builder->fromParent())
);

$this->addFieldResolverIfNotExists($type, 'language',
Expand Down
8 changes: 6 additions & 2 deletions modules/thunder_gqls/tests/src/Functional/SchemaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,12 @@ public function testLabelAccess(): void {
$this->assertEquals(200, $response->getStatusCode(), 'Response not 200');

$page = $this->jsonDecode($response->getBody());
file_put_contents('test-output.txt', print_r($page, TRUE));

$this->assertArrayNotHasKey('errors', $page);
$this->assertArrayHasKey('data', $page);
$this->assertArrayHasKey('page', $page['data']);
$this->assertArrayHasKey('channel', $page['data']['page']);
$this->assertArrayHasKey('name', $page['data']['page']['channel']);
$this->assertEmpty($page['data']['page']['channel']['name']);
}

}

0 comments on commit 844b639

Please sign in to comment.