mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
fix(#62): webhook plugins are stale for 60 minutes by default
This commit is contained in:
parent
c20e1a9a58
commit
a44479a48a
3 changed files with 30 additions and 4 deletions
|
|
@ -71,3 +71,25 @@ test('updateDataPayload sends POST request with body when polling_verb is post',
|
|||
$request->body() === '{"query": "query { user { id name } }"}';
|
||||
});
|
||||
});
|
||||
|
||||
test('webhook plugin is stale if webhook event occurred', function () {
|
||||
$plugin = Plugin::factory()->create([
|
||||
'data_strategy' => 'webhook',
|
||||
'data_payload_updated_at' => now()->subMinutes(10),
|
||||
'data_stale_minutes' => 60, // Should be ignored for webhook
|
||||
]);
|
||||
|
||||
expect($plugin->isDataStale())->toBeTrue();
|
||||
|
||||
});
|
||||
|
||||
test('webhook plugin data not stale if no webhook event occurred for 1 hour', function () {
|
||||
$plugin = Plugin::factory()->create([
|
||||
'data_strategy' => 'webhook',
|
||||
'data_payload_updated_at' => now()->subMinutes(60),
|
||||
'data_stale_minutes' => 60, // Should be ignored for webhook
|
||||
]);
|
||||
|
||||
expect($plugin->isDataStale())->toBeFalse();
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue