fix(checkout): don't skip the edit page of a one-plan product in the cart

This commit is contained in:
dualfroz committed 2026-10-03 16:14:23 +02:00
1 parent 963b96fed9
commit 40c8d613ba
2 files changed
+23 -1

No files matched your search

+22
View File
@@ -72,6 +72,28 @@ class CheckoutTest extends TestCase
]);
}
public function test_checkout_page_does_not_redirect_if_one_plan_when_editing_cart_item(): void
{
$this->get(route('products.checkout', [
$this->product->product->category->slug,
$this->product->product->slug,
]))->assertRedirect(route('cart'));
$cart = Cart::where('currency_code', 'USD')->firstOrFail();
$item = $cart->items()->firstOrFail();
Once::flush();
$response = $this->withCookie('cart', $cart->ulid)->get(route('products.checkout', [
$this->product->product->category->slug,
$this->product->product->slug,
'edit' => $item->id,
]));
$response->assertStatus(200);
$response->assertSee($this->product->product->name);
}
public function test_checkout_page_with_multiple_plans(): void
{
// Add plan