Deploy Ladill Events / deploy (push) Successful in 1m30s
Standardize customer-facing Ladill Pay checkout shells across products, open them on all viewports, and escape iframe callbacks back to the product flow.
38 lines
1.3 KiB
PHP
38 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use Tests\TestCase;
|
|
|
|
class ResponsivePaystackSheetTest extends TestCase
|
|
{
|
|
public function test_checkout_sheet_partial_has_mobile_sheet_and_desktop_modal(): void
|
|
{
|
|
$html = view('partials.paystack-sheet', [
|
|
'audience' => 'buyer',
|
|
])->render();
|
|
|
|
$this->assertStringContainsString('role="dialog"', $html);
|
|
$this->assertStringContainsString('aria-modal="true"', $html);
|
|
$this->assertStringContainsString('md:items-center', $html);
|
|
$this->assertStringContainsString('rounded-t-2xl', $html);
|
|
$this->assertStringContainsString('md:h-[min(720px,85vh)]', $html);
|
|
$this->assertStringContainsString('Complete your payment', $html);
|
|
$this->assertStringNotContainsString('Paystack checkout', $html);
|
|
}
|
|
|
|
public function test_payment_return_escapes_iframe_to_top(): void
|
|
{
|
|
$html = view('public.payment-return', [
|
|
'redirect' => 'https://example.test/paid',
|
|
])->render();
|
|
|
|
$this->assertStringContainsString('Confirming your payment', $html);
|
|
$this->assertStringContainsString('window.top.location.replace', $html);
|
|
$this->assertTrue(
|
|
str_contains($html, 'https://example.test/paid')
|
|
|| str_contains($html, 'https:\/\/example.test\/paid')
|
|
);
|
|
}
|
|
}
|