Skip to content

Commit d0de4fd

Browse files
committed
Fixed failing webhook test cases
1 parent 00eedaf commit d0de4fd

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app/Actions/DispatchWebhookJob.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ public function handle()
7979
->withOptions(['allow_redirects' => ['strict' => true]])
8080
->timeout($this->webhook->timeout)
8181
->post($this->webhook->endpoint, $webhookData);
82-
8382
} catch (\Exception $exception) {
8483
$lastError = $exception->getMessage();
8584
Log::error("Webhook call to endpoint {$this->webhook->endpoint} failed with error \"{$lastError}\"");

tests/Actions/WebhookManagementTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public function test_store()
3939
'endpoint' => 'https://example.com/webhook',
4040
'events' => ['all'],
4141
'active' => 'true',
42+
'timeout' => 4,
4243
]);
4344

4445
$resp->assertRedirect('/settings/webhooks');
@@ -51,6 +52,7 @@ public function test_store()
5152
'name' => 'My first webhook',
5253
'endpoint' => 'https://example.com/webhook',
5354
'active' => true,
55+
'timeout' => 4,
5456
]);
5557

5658
/** @var Webhook $webhook */
@@ -82,6 +84,7 @@ public function test_update()
8284
'endpoint' => 'https://example.com/updated-webhook',
8385
'events' => [ActivityType::PAGE_CREATE, ActivityType::PAGE_UPDATE],
8486
'active' => 'true',
87+
'timeout' => 5
8588
]);
8689
$resp->assertRedirect('/settings/webhooks');
8790

@@ -93,6 +96,7 @@ public function test_update()
9396
'name' => 'My updated webhook',
9497
'endpoint' => 'https://example.com/updated-webhook',
9598
'active' => true,
99+
'timeout' => 5,
96100
]);
97101

98102
$trackedEvents = $webhook->trackedEvents()->get();

0 commit comments

Comments
 (0)