Skip to content

Commit

Permalink
Test section display and instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Feb 18, 2025
1 parent 8e0592b commit 24ca280
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/Feature/GraphQL/FormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,13 @@ public function it_queries_the_sections()
'message' => ['type' => 'textarea', 'width' => 33],
]);

// Set section display and instructions. You wouldn't really do this for a form blueprint,
// but this is just to test the section type which doesn't get tested anywhere else.
$contents = $blueprint->contents();
$contents['tabs']['main']['sections'][0]['display'] = 'My Section';
$contents['tabs']['main']['sections'][0]['instructions'] = 'The section instructions';
$blueprint->setContents($contents);

BlueprintRepository::shouldReceive('find')->with('forms.contact')->andReturn($blueprint);

$query = <<<'GQL'
Expand Down Expand Up @@ -265,8 +272,8 @@ public function it_queries_the_sections()
'form' => [
'sections' => [
[
'display' => null,
'instructions' => null,
'display' => 'My Section',
'instructions' => 'The section instructions',
'fields' => [
[
'handle' => 'name',
Expand Down

0 comments on commit 24ca280

Please sign in to comment.