© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
1 reply
UnkownUser20003

Testing the update on SelectColumn

Hi All,

I am currently using a SelectColumn to update a order status. After updating i send the user a notification that the status was updated. Now I want to write tests to test if the notification in actually send. However I am running into the issue that I cannot figure out how to actually test this behaviour as I can't find a way to trigger the select.



SelectColumn::make('status')
                    ->label(__('order.status'))
                    ->options(self::getOrderStatuses())
                    ->selectablePlaceholder(false)
                    ->searchable()
                    ->sortable()
                    ->afterStateUpdated(function ($record, $state) {
                        if ($record->status != $state) {
                            Notification::make()
                                ->title('Status gewijzigd')
                                ->body('De status van OD' . $record->order_number . ' is gewijzigd naar ' . OrderStatus::from($state)->getLabel())
                                ->success()
                                ->send();
                        }
                    }),
SelectColumn::make('status')
                    ->label(__('order.status'))
                    ->options(self::getOrderStatuses())
                    ->selectablePlaceholder(false)
                    ->searchable()
                    ->sortable()
                    ->afterStateUpdated(function ($record, $state) {
                        if ($record->status != $state) {
                            Notification::make()
                                ->title('Status gewijzigd')
                                ->body('De status van OD' . $record->order_number . ' is gewijzigd naar ' . OrderStatus::from($state)->getLabel())
                                ->success()
                                ->send();
                        }
                    }),


Thanks!
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 update selectColumn
FilamentFFilament / ❓┊help
2y ago
Tips for testing the selectcolumn on a table?
FilamentFFilament / ❓┊help
2y ago
Update specific column after selecting on SelectColumn
FilamentFFilament / ❓┊help
3y ago
searchable on SelectColumn?
FilamentFFilament / ❓┊help
2y ago