© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•6mo ago•
5 replies
Jonathan Christiani

Testing page footer actions in v4

I'm attempting to call a page footer action in a test for a resource page. Typically, in an
EditRecord
EditRecord
page for example, we would have these footer actions:
protected function getFormActions(): array
{
    return [
        $this->getSaveFormAction(), // Uses `->submit('save')` or `->action(...)`
        $this->getCancelFormAction(), // Uses an Alpine click handler
    ];
}
protected function getFormActions(): array
{
    return [
        $this->getSaveFormAction(), // Uses `->submit('save')` or `->action(...)`
        $this->getCancelFormAction(), // Uses an Alpine click handler
    ];
}

One essentially fires the public
save()
save()
function through
wire:submit
wire:submit
and the other uses JS (and doesn't really need testing).

For those that call public functions, typically one can test by using
->call(…)
->call(…)
in the test, bypassing having to mount the action, etc.

For header actions,
->callAction(TestAction::make('header_action'))
->callAction(TestAction::make('header_action'))
works because it's at the top level of the component, but footer actions cannot be resolved and called by the same function.

Consider a custom footer action:
protected function getFormActions(): array
{
    return [
        // ...

        Action::make('footer_action')
            ->action(function () {
                // ...
            }),
    ];
}
protected function getFormActions(): array
{
    return [
        // ...

        Action::make('footer_action')
            ->action(function () {
                // ...
            }),
    ];
}

Attempting
->callAction(TestAction::make('footer_action'))
->callAction(TestAction::make('footer_action'))
leads to a failed assertion that the footer action is visible.

The composition of pages has changed in v4 with schemas,
Form
Form
components,
EmbeddedSchemas
EmbeddedSchemas
etc., and it's quite confusing to know exactly which combinations of
$component
$component
and
$schema
$schema
parameters to use with
->schemaComponent($component, $schema)
->schemaComponent($component, $schema)
on
TestAction
TestAction
.

It would seem that now, these actions have become children of an
Actions
Actions
component in the footer of a
Form
Form
, which eventually forms part of the
content
content
Schema
Schema
.

What function calls should I make on the Livewire
Testable
Testable
to target these (form) footer actions?
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

Testing Section header/footer Actions
FilamentFFilament / ❓┊help
3mo ago
Actions in footer (bottom of ViewRecord page)
FilamentFFilament / ❓┊help
3y ago
Filament V4 Custom footer
FilamentFFilament / ❓┊help
6mo ago
Modal footer actions alignment
FilamentFFilament / ❓┊help
2y ago