but I always got error, below are my test and error I had.
// Testit('has a form', function () { livewire(AnnouncementResource\Pages\ManageAnnouncements::class) ->mountAction('create') ->assertFormExists();});it('has form fields', function (string $field) { livewire(AnnouncementResource\Pages\ManageAnnouncements::class) ->mountAction('create') ->assertFormFieldExists($field);})->with(['title', 'detail']);
// Testit('has a form', function () { livewire(AnnouncementResource\Pages\ManageAnnouncements::class) ->mountAction('create') ->assertFormExists();});it('has form fields', function (string $field) { livewire(AnnouncementResource\Pages\ManageAnnouncements::class) ->mountAction('create') ->assertFormFieldExists($field);})->with(['title', 'detail']);
Error => Argument #1 ($form) must be of type Filament\Forms\Form, Filament\Infolists\Infolist given.
Error => Argument #1 ($form) must be of type Filament\Forms\Form, Filament\Infolists\Infolist given.
How Can I make this test pass. thanks in advance EDITED: Now error only on form
Solution
because it is not a form, it is a modal form. You could verify if the action was called or if the modal form contains something using