diff --git a/tests/Feature/AdminSiteSubscriptionIndexBatchMarkExpiredBlockedHintGoExpiredLinkShouldKeepEndsAtRangeFiltersTest.php b/tests/Feature/AdminSiteSubscriptionIndexBatchMarkExpiredBlockedHintGoExpiredLinkShouldKeepEndsAtRangeFiltersTest.php new file mode 100644 index 0000000..bcad263 --- /dev/null +++ b/tests/Feature/AdminSiteSubscriptionIndexBatchMarkExpiredBlockedHintGoExpiredLinkShouldKeepEndsAtRangeFiltersTest.php @@ -0,0 +1,37 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_go_expired_link_should_keep_ends_at_range_filters(): void + { + $this->loginAsPlatformAdmin(); + + // 不在 expiry=expired 集合时,blocked hint 的“一键切到已过期集合”应保留当前 ends_from/ends_to(减少重复输入)。 + $res = $this->get('/admin/site-subscriptions?ends_from=2026-03-01&ends_to=2026-03-31'); + $res->assertOk(); + + $html = (string) $res->getContent(); + + $this->assertStringContainsString('data-role="batch-mark-expired-blocked-hint"', $html); + $this->assertStringContainsString('expiry=expired', $html); + $this->assertStringContainsString('ends_from=2026-03-01', $html); + $this->assertStringContainsString('ends_to=2026-03-31', $html); + } +}