Skip to content

Commit b97c299

Browse files
Add support for RichEditor in create record test
1 parent 3c45527 commit b97c299

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
1+
@php use Filament\Forms\Components\RichEditor; @endphp
12
it('can create a record', function (): void {
23
$record = {{ $getResourceModel() }}::factory()->make();
34

45
livewire({{ $getPageClass('create') }}::class)
56
->fillForm([
67
@foreach($getResourceFormFields() as $key => $field)
8+
@if($field instanceof RichEditor)
9+
// TODO: RichEditor expects a very specific array structure for its data and Filament tests do not currently support this.
10+
// '{{ $key }}' => $record->{{ $key }},
11+
@else
712
'{{ $key }}' => $record->{{ $key }},
13+
@endif
814
@endforeach
915
])
1016
->call('create')
1117
->assertNotified();
1218

1319
$this->assertDatabaseHas({{ $getResourceModel() }}::class, [
1420
@foreach($getResourceFormFields() as $key => $field)
21+
@if($field instanceof RichEditor)
22+
// TODO: RichEditor expects a very specific array structure for its data and Filament tests do not currently support this.
23+
// '{{ $key }}' => $record->{{ $key }},
24+
@else
1525
'{{ $key }}' => $record->{{ $key }},
26+
@endif
1627
@endforeach
1728
]);
1829
});

0 commit comments

Comments
 (0)