Testting anonymous actions

I have an infolist (ViewProject.php) for my ProjectResource. This just displays a number of sections and groups. Of of those sections contains a number of anonymous actions, like:

Action::make('invite-teacher')
  ->label('Docent uitnodigen')
  ->icon('heroicon-m-academic-cap')
  ->color('darkGreen')
  ->disabled(function ($record) {
    return !isset($record->teacher);
  })
  ->requiresConfirmation()
  ->action(function ($record) {
    $from = Filament::getTenant();
    SendTeacherInviteEmail::dispatch($record, $from);
    Notification::make('teacher-invited')
      ->title('Uitnodiging verzonden!')
      ->success()
      ->send();
}),


The action itself works just fine, i just have no idea how to reach this action in a (pest) test. Can someone point me in the right direction or tell me how i can refactor if i need to rewrite my actions.
Was this page helpful?