diff --git a/tests/Feature/AdminPlatformOrderFiltersReceiptStatusHintLinkShouldMatchPaidNoReceiptQuickFilterTest.php b/tests/Feature/AdminPlatformOrderFiltersReceiptStatusHintLinkShouldMatchPaidNoReceiptQuickFilterTest.php new file mode 100644 index 0000000..555b3ec --- /dev/null +++ b/tests/Feature/AdminPlatformOrderFiltersReceiptStatusHintLinkShouldMatchPaidNoReceiptQuickFilterTest.php @@ -0,0 +1,54 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_receipt_status_hint_link_should_match_paid_no_receipt_quick_filter_scope(): void + { + $this->loginAsPlatformAdmin(); + + $res = $this->get('/admin/platform-orders?' . Arr::query([ + 'merchant_id' => 2, + 'plan_id' => 3, + 'keyword' => 'alpha', + 'back' => '/admin/plans', + ])); + $res->assertOk(); + + $html = (string) $res->getContent(); + + preg_match('/data-role="po-receipt-status-broad-none-go-paid-no-receipt"[^>]*href="([^"]+)"/u', $html, $m1); + preg_match('/data-role="po-quickfilter-paid-no-receipt"[^>]*href="([^"]+)"/u', $html, $m2); + + $this->assertNotEmpty($m1[1] ?? ''); + $this->assertNotEmpty($m2[1] ?? ''); + + $hintHref = html_entity_decode($m1[1]); + $quickHref = html_entity_decode($m2[1]); + + $hintQuery = parse_url($hintHref, PHP_URL_QUERY) ?: ''; + $quickQuery = parse_url($quickHref, PHP_URL_QUERY) ?: ''; + + parse_str($hintQuery, $hint); + parse_str($quickQuery, $quick); + + $this->assertSame($quick, $hint); + } +}