From 74a2f0165162f96e717a00975a0ab5616f20ff05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Tue, 17 Mar 2026 06:32:36 +0800 Subject: [PATCH] =?UTF-8?q?test(site-subscriptions):=20blocked=20hint=20go?= =?UTF-8?q?-expired=20=E4=BF=9D=E7=95=99=20ends=5Fat=20=E5=8C=BA=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...edLinkShouldKeepEndsAtRangeFiltersTest.php | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/Feature/AdminSiteSubscriptionIndexBatchMarkExpiredBlockedHintGoExpiredLinkShouldKeepEndsAtRangeFiltersTest.php 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); + } +}