Maxi
Maxi
Explore posts from servers
FFilament
Created by Maxi on 10/23/2024 in #❓┊help
How to test modal actions?
I registered a modal action using the registerModalActions() function and when I mount the "parent" action and use the assertSee() function to check for the modal action's label I can find it just fine, but if I try to actuall call the modal action it says that no action with that name exists on my page, do I maybe have to load the action differently? This is how I'm currently trying to access it:
it('can use modal action', function () {
// boilerplate
livewire(PageResource::class)
->mountAction(ImportAction::class)
->assertActionExists('mymodalaction') // -> returns: Failed asserting that it exists
->assertSee('The label of my modal action'); // returns: true
})->only();
it('can use modal action', function () {
// boilerplate
livewire(PageResource::class)
->mountAction(ImportAction::class)
->assertActionExists('mymodalaction') // -> returns: Failed asserting that it exists
->assertSee('The label of my modal action'); // returns: true
})->only();
15 replies