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();
                        }
                    }),


Thanks!
Was this page helpful?