diff --git a/tests/Feature/AdminPlatformOrderFiltersReceiptStatusHintLinkShouldKeepBackTest.php b/tests/Feature/AdminPlatformOrderFiltersReceiptStatusHintLinkShouldKeepBackTest.php new file mode 100644 index 0000000..b318f02 --- /dev/null +++ b/tests/Feature/AdminPlatformOrderFiltersReceiptStatusHintLinkShouldKeepBackTest.php @@ -0,0 +1,43 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_receipt_status_hint_link_should_keep_back_query(): 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, $m); + $href = html_entity_decode($m[1] ?? ''); + $query = parse_url($href, PHP_URL_QUERY) ?: ''; + parse_str($query, $q); + + $this->assertSame('/admin/plans', (string) ($q['back'] ?? '')); + } +}