test(stock): cover aggregate reservation lifecycle

This commit is contained in:
2026-08-25 15:05:29 -03:00
parent 24bfef431b
commit e5f7ba3615
6 changed files with 222 additions and 104 deletions

View File

@@ -520,8 +520,10 @@ class AdminAppSaleControllerTest extends TestCase
->assertJsonPath('data.status', Purchase::STATUS_CANCELLED);
$this->assertSoftDeleted('carritos', ['id' => $sourceCartId]);
$reservationId = $purchase->fresh()->stock_reservation_id;
$this->assertNotNull($reservationId);
$this->assertDatabaseHas('stock_reservations', [
'purchase_id' => $purchase->id,
'id' => $reservationId,
'status' => 'released',
]);
}