© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
marco.ferreira

Testing a confirming action

I'm trying to make a test that ensures that if an action that requires confirmation is called and the user does not confirm the operation then it is not called. For simplicity sake, imagine it is a table's delete action.
What can I do to simulate the user dismissing the dialog instead of submiting it?

Here's what I have so far:
$page = livewire(MyResourceListPage::class)
    ->assertCountTableRecords(1)
    ->assertTableActionExists('delete')
    ->mountTableAction('delete', $businessArea)
    ->assertTableActionHalted('delete');

    // Now I would dismiss the confirmation dialog
    //How??

    // And make sure the record was not deleted
    expect(MyModel::query()->where('id', $knownId)->count())->toBe(1);
$page = livewire(MyResourceListPage::class)
    ->assertCountTableRecords(1)
    ->assertTableActionExists('delete')
    ->mountTableAction('delete', $businessArea)
    ->assertTableActionHalted('delete');

    // Now I would dismiss the confirmation dialog
    //How??

    // And make sure the record was not deleted
    expect(MyModel::query()->where('id', $knownId)->count())->toBe(1);
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Testing a form action.
FilamentFFilament / ❓┊help
2y ago
ActionGroups and Testing
FilamentFFilament / ❓┊help
17mo ago
Testing a Form Suffix Action
FilamentFFilament / ❓┊help
3y ago
testing table action
FilamentFFilament / ❓┊help
2y ago