Fixed failing webhook test cases

This commit is contained in:
Dan Brown 2022-01-03 19:51:13 +00:00
parent 00eedafbfd
commit d0de4fd8f9
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
2 changed files with 4 additions and 1 deletions

View file

@ -79,7 +79,6 @@ class DispatchWebhookJob implements ShouldQueue
->withOptions(['allow_redirects' => ['strict' => true]])
->timeout($this->webhook->timeout)
->post($this->webhook->endpoint, $webhookData);
} catch (\Exception $exception) {
$lastError = $exception->getMessage();
Log::error("Webhook call to endpoint {$this->webhook->endpoint} failed with error \"{$lastError}\"");

View file

@ -39,6 +39,7 @@ class WebhookManagementTest extends TestCase
'endpoint' => 'https://example.com/webhook',
'events' => ['all'],
'active' => 'true',
'timeout' => 4,
]);
$resp->assertRedirect('/settings/webhooks');
@ -51,6 +52,7 @@ class WebhookManagementTest extends TestCase
'name' => 'My first webhook',
'endpoint' => 'https://example.com/webhook',
'active' => true,
'timeout' => 4,
]);
/** @var Webhook $webhook */
@ -82,6 +84,7 @@ class WebhookManagementTest extends TestCase
'endpoint' => 'https://example.com/updated-webhook',
'events' => [ActivityType::PAGE_CREATE, ActivityType::PAGE_UPDATE],
'active' => 'true',
'timeout' => 5
]);
$resp->assertRedirect('/settings/webhooks');
@ -93,6 +96,7 @@ class WebhookManagementTest extends TestCase
'name' => 'My updated webhook',
'endpoint' => 'https://example.com/updated-webhook',
'active' => true,
'timeout' => 5,
]);
$trackedEvents = $webhook->trackedEvents()->get();