diff --git a/tests/src/Actions/ActionTest.php b/tests/src/Actions/ActionTest.php index f27128e161..85404e4877 100644 --- a/tests/src/Actions/ActionTest.php +++ b/tests/src/Actions/ActionTest.php @@ -3,6 +3,7 @@ use Filament\Actions\Action; use Filament\Actions\Testing\TestAction; use Filament\Notifications\Notification; +use Filament\Pages\Page; use Filament\Support\Icons\Heroicon; use Filament\Tests\Actions\TestCase; use Filament\Tests\Fixtures\Pages\Actions; @@ -132,6 +133,18 @@ it('can mount an action with arguments', function (): void { ]); }); +it('can mount an action record with arguments', function (): void { + livewire(Actions::class) + ->mountAction([ + TestAction::make('record-arguments')->arguments(['key' => 123]), + 'record-arguments', + ]) + ->callMountedAction() + ->assertDispatched('record-arguments-called', arguments: [ + 'key' => 123, + ]); +}); + it('can mount a nested action with parent arguments', function (): void { livewire(Actions::class) ->mountAction([ diff --git a/tests/src/Fixtures/Pages/Actions.php b/tests/src/Fixtures/Pages/Actions.php index d9fae1de62..6dd5ad2180 100644 --- a/tests/src/Fixtures/Pages/Actions.php +++ b/tests/src/Fixtures/Pages/Actions.php @@ -47,6 +47,8 @@ class Actions extends Page $this->dispatch('nested-called', arguments: $arguments); }), ]), + Action::make('record-arguments') + ->record(fn (array $arguments) => $arguments['key']), Action::make('parent') ->schema([ TextInput::make('foo')