From c0e3dffce1cbfb24f4a213777a6aa581b44fb2ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Tue, 17 Mar 2026 00:10:50 +0800 Subject: [PATCH] Tests: ensure clear BMPA errors button disables when sync_status/synced_only present --- ...sShouldDisableWhenNotInFailedScopeTest.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/Feature/AdminPlatformOrderIndexClearErrorButtonsShouldDisableWhenNotInFailedScopeTest.php b/tests/Feature/AdminPlatformOrderIndexClearErrorButtonsShouldDisableWhenNotInFailedScopeTest.php index dee6633..edee9e9 100644 --- a/tests/Feature/AdminPlatformOrderIndexClearErrorButtonsShouldDisableWhenNotInFailedScopeTest.php +++ b/tests/Feature/AdminPlatformOrderIndexClearErrorButtonsShouldDisableWhenNotInFailedScopeTest.php @@ -90,4 +90,36 @@ class AdminPlatformOrderIndexClearErrorButtonsShouldDisableWhenNotInFailedScopeT $this->assertTrue(str_contains($html, 'type="submit" disabled') || str_contains($html, 'disabled="disabled"')); } + + public function test_clear_bmpa_errors_button_should_disable_when_sync_status_filter_present_even_if_in_bmpa_failed_scope(): void + { + $this->loginAsPlatformAdmin(); + + $res = $this->get('/admin/platform-orders?bmpa_failed_only=1&sync_status=failed'); + $res->assertOk(); + + $html = (string) $res->getContent(); + + $this->assertStringContainsString('清除批量标记支付失败标记(当前筛选范围)', $html); + $this->assertStringContainsString('data-role="clear-bmpa-errors-blocked-hint"', $html); + $this->assertStringContainsString('同步状态', $html); + + $this->assertTrue(str_contains($html, 'type="submit" disabled') || str_contains($html, 'disabled="disabled"')); + } + + public function test_clear_bmpa_errors_button_should_disable_when_synced_only_filter_present_even_if_in_bmpa_failed_scope(): void + { + $this->loginAsPlatformAdmin(); + + $res = $this->get('/admin/platform-orders?bmpa_failed_only=1&synced_only=1'); + $res->assertOk(); + + $html = (string) $res->getContent(); + + $this->assertStringContainsString('清除批量标记支付失败标记(当前筛选范围)', $html); + $this->assertStringContainsString('data-role="clear-bmpa-errors-blocked-hint"', $html); + $this->assertStringContainsString('已同步', $html); + + $this->assertTrue(str_contains($html, 'type="submit" disabled') || str_contains($html, 'disabled="disabled"')); + } }