© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
5 replies
Frittenfred

how to test a view modal action?

Hello Folks,

i'm testing my Laravel Filament application and i want to test if guests can access a view which opens via a modal.


                
Tables\Actions\ViewAction::make()
        ->label('')
        ->slideOver()
        ->modalWidth(MaxWidth::Medium),
                
Tables\Actions\ViewAction::make()
        ->label('')
        ->slideOver()
        ->modalWidth(MaxWidth::Medium),


i want to test if a guest or people without permission can access the view modal as Action. i have allready a test to check if the table gets rendered and showed. that is forbidden and redirects, that works. but i would like to test if someone could open only a action and i don't know right how to test a modal action that only works for a administrator.


my code at this time :

     Livewire::test(ViewAction::class, [
         'record' => $user->getRouteKey()
      ])
          ->assertForbidden();
     Livewire::test(ViewAction::class, [
         'record' => $user->getRouteKey()
      ])
          ->assertForbidden();


someone a idea ?
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

How to test modal actions?
FilamentFFilament / ❓┊help
16mo ago
View in Modal Action
FilamentFFilament / ❓┊help
3mo ago
How to test modal footer actions
FilamentFFilament / ❓┊help
9mo ago
test select action inside modal
FilamentFFilament / ❓┊help
15mo ago