Implement Discord webhook delivery
This commit is contained in:
@@ -117,12 +117,28 @@ class TicketStatusChangedNotificationDispatchTest extends TestCase
|
||||
&& $job->payload->fromStatusLabel === 'Backlog'
|
||||
&& $job->payload->toStatusId === $doingStatus->id
|
||||
&& $job->payload->toStatusLabel === 'Doing'
|
||||
&& $job->payload->eventType === NotificationEventType::TicketStatusChanged;
|
||||
&& $job->payload->eventType === NotificationEventType::TicketStatusChanged
|
||||
&& $job->notificationDeliveryLogId !== null;
|
||||
});
|
||||
Queue::assertPushed(DeliverNotificationAction::class, fn (DeliverNotificationAction $job): bool => $job->notificationActionId === $discordAction->id);
|
||||
Queue::assertPushed(DeliverNotificationAction::class, fn (DeliverNotificationAction $job): bool => $job->notificationActionId === $discordAction->id
|
||||
&& $job->notificationDeliveryLogId !== null);
|
||||
Queue::assertNotPushed(DeliverNotificationAction::class, fn (DeliverNotificationAction $job): bool => $job->notificationActionId === $disabledAction->id);
|
||||
Queue::assertNotPushed(DeliverNotificationAction::class, fn (DeliverNotificationAction $job): bool => $job->notificationActionId === $foreignProjectAction->id);
|
||||
|
||||
$this->assertDatabaseCount('notification_delivery_logs', 2);
|
||||
$this->assertDatabaseHas('notification_delivery_logs', [
|
||||
'notification_action_id' => $webhookAction->id,
|
||||
'delivery_status' => NotificationDeliveryStatus::Pending->value,
|
||||
'attempt_count' => 0,
|
||||
'http_status' => null,
|
||||
]);
|
||||
$this->assertDatabaseHas('notification_delivery_logs', [
|
||||
'notification_action_id' => $discordAction->id,
|
||||
'delivery_status' => NotificationDeliveryStatus::Pending->value,
|
||||
'attempt_count' => 0,
|
||||
'http_status' => null,
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('ticket_worklog_entries', [
|
||||
'ticket_id' => $ticket->id,
|
||||
'actor_id' => $user->id,
|
||||
|
||||
Reference in New Issue
Block a user