© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•17mo ago•
1 reply
Naseg

Testing form actions

Couldn't see this in the docs. Given that a livewire component is set up with a custom form and action as follows:

public function form(Form $form): Form
{
    return $form->schema([
        TextInput::make('name')
            ->required(),
        Actions::make([
            Action::make('action')
                ->action(/** doing something **/)
    ]);
}
public function form(Form $form): Form
{
    return $form->schema([
        TextInput::make('name')
            ->required(),
        Actions::make([
            Action::make('action')
                ->action(/** doing something **/)
    ]);
}


With the following test (which fails) I can't find a way to pass the form to callAction order to test the action:

livewire(MyPage::class)
    ->fillForm([
        'name' => 'something'
    ])
    ->callAction('action');
livewire(MyPage::class)
    ->fillForm([
        'name' => 'something'
    ])
    ->callAction('action');

This results in Failed asserting that an action with name [action] exists on the [App\Filament\Pages\MyPage] page. Does such functionality exist?

Here a component name should be provided but we don't have one.

livewire(MyPage::class)
    ->fillForm([
        'name' => 'something'
    ])
    ->assertFormComponentActionExists('component','action')
}
livewire(MyPage::class)
    ->fillForm([
        'name' => 'something'
    ])
    ->assertFormComponentActionExists('component','action')
}

We need to solve this.
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 infolist actions
FilamentFFilament / ❓┊help
3y ago
Form Testing
FilamentFFilament / ❓┊help
2y ago
RelationManager form actions
FilamentFFilament / ❓┊help
2y ago
Testing relation manager actions
FilamentFFilament / ❓┊help
12mo ago