How can I test a form from a modal? (simple resource)

I have some resources made with --simple flag, so they don't have Create,
Edit
or View pages, only the Manage class. I would like to know 2 things, how to assert the modal rendering and how to test the form (because the fillForm seems to not work in this case).

1 - is this a good assertion for the "render modal test"?
livewire($manageModelClass)
    ->callAction('create')
    ->assertSeeHtml('fi-modal-window')
    ->assertSee('Create');


2 - how to use the fillForm for modals?
livewire($manageModelClass)
    ->callAction('create') // it does render the modal
    ->assertFormExists() // error
    ->fillForm($formData) // error
Solution
$data = [
    'title' => 'Title',
    'description' => 'Description',
    ...
];

livewire(ManageXXX::class)
    ->callAction('create', data: $data)
    ->assertHasNoActionErrors();


https://filamentphp.com/docs/3.x/actions/testing
Was this page helpful?