UnkownUser20003
UnkownUser20003
FFilament
Created by UnkownUser20003 on 5/19/2024 in #❓┊help
Tips for testing the selectcolumn on a table?
How can i test the SelectColumn on table?
4 replies
FFilament
Created by UnkownUser20003 on 4/13/2024 in #❓┊help
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!
2 replies