Skip to content

Commit

Permalink
Add test for rendering fields in Grid
Browse files Browse the repository at this point in the history
  • Loading branch information
evelynfredin committed Jan 10, 2025
1 parent 3f359cf commit 492ed8d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/Unit/Fields/GridTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,11 @@

expect($field->toArray()['field']['mode'])->toBe(\Tdwesten\StatamicBuilder\Enums\GridModeOption::Table->value);
});

it('can render to a array with fields', function () {
$field = new \Tdwesten\StatamicBuilder\FieldTypes\Grid('grid', [
new \Tdwesten\StatamicBuilder\FieldTypes\Text('title'),
]);

expect($field->toArray()['field']['fields'][0]['field']['type'])->toBe('text');
});

0 comments on commit 492ed8d

Please sign in to comment.