test(stock): cover authoritative reservation expiration

This commit is contained in:
2026-08-25 15:28:23 -03:00
parent 7a85e1731d
commit f982bcead1
5 changed files with 106 additions and 62 deletions

View File

@@ -62,6 +62,10 @@ class TelepagosWebhookTest extends TestCase
public function test_transfer_payment_intent_persists_transfer_payer_dni_without_replacing_customer_dni(): void
{
config()->set('purchase.payment_expiration_minutes.transfer', 60);
$now = now()->startOfSecond();
$this->travelTo($now);
$tenant = $this->createTenant('sonder', 'Sonder', 'sonder.com.ar');
$this->configureTelepagosIntegration($tenant);
$user = User::factory()->create();
@@ -99,6 +103,13 @@ class TelepagosWebhookTest extends TestCase
'payment_method' => 'transfer',
'status' => Purchase::STATUS_PENDING_PAYMENT,
]);
$this->assertDatabaseHas('stock_reservations', [
'id' => $purchase->stock_reservation_id,
'status' => 'active',
'expires_at' => $now->copy()->addMinutes(60)->toDateTimeString(),
]);
$this->travelBack();
}
public function test_transfer_webhook_matches_pending_purchase_by_dni_and_total_amount(): void