© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3mo ago•
2 replies
Harvey

Test Section header action

How can I test an action that's inside a Section header:
Section::make('Search')
  ->headerActions([
      Action::make('csv_import')
        ->action(...)
  ])
  ->schema([
    ...
  ]),
Section::make('Search')
  ->headerActions([
      Action::make('csv_import')
        ->action(...)
  ])
  ->schema([
    ...
  ]),


I have tried:
Livewire::actingAs($this->user)
  ->test(Search::class)
  ->assertActionVisible(TestAction::make('import_csv')->schemaComponent(''));
Livewire::actingAs($this->user)
  ->test(Search::class)
  ->assertActionVisible(TestAction::make('import_csv')->schemaComponent(''));


and I get the following error:
Failed asserting that an action with name [import_csv] is visible on the [App\Livewire\Search] component.
Failed asserting that an action with name [import_csv] is visible on the [App\Livewire\Search] component.


I have also tried with the
schemaComponent
schemaComponent
being
form, data, search
form, data, search
but same error message.

Any ideas?

I see in the html the following too on my action:
{
  "schemaComponent": "form"
}
{
  "schemaComponent": "form"
}
Solution
could you try this?
Testing Section header/footer Actions
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Section header action hanging
FilamentFFilament / ❓┊help
4mo ago
Submitting form from Section header action
FilamentFFilament / ❓┊help
2y ago
Testing Section header/footer Actions
FilamentFFilament / ❓┊help
3mo ago
Call table header action during test
FilamentFFilament / ❓┊help
16mo ago