From 1550a0a6508bcb7a733a5696c36e80dd0d69f01a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Wed, 18 Mar 2026 03:17:04 +0800 Subject: [PATCH] test(platform-orders): ensure bmpa_processable_only checkbox renders and keeps checked --- ...dRenderBmpaProcessableOnlyCheckboxTest.php | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 tests/Feature/AdminPlatformOrderFiltersShouldRenderBmpaProcessableOnlyCheckboxTest.php diff --git a/tests/Feature/AdminPlatformOrderFiltersShouldRenderBmpaProcessableOnlyCheckboxTest.php b/tests/Feature/AdminPlatformOrderFiltersShouldRenderBmpaProcessableOnlyCheckboxTest.php new file mode 100644 index 0000000..00066b7 --- /dev/null +++ b/tests/Feature/AdminPlatformOrderFiltersShouldRenderBmpaProcessableOnlyCheckboxTest.php @@ -0,0 +1,45 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_platform_orders_filters_should_render_bmpa_processable_only_checkbox(): void + { + $this->loginAsPlatformAdmin(); + + $html = $this->get('/admin/platform-orders') + ->assertOk() + ->getContent(); + + $this->assertStringContainsString('name="bmpa_processable_only"', $html); + $this->assertStringContainsString('只看可BMPA处理', $html); + } + + public function test_platform_orders_filters_should_keep_checkbox_checked_when_enabled(): void + { + $this->loginAsPlatformAdmin(); + + $html = $this->get('/admin/platform-orders?bmpa_processable_only=1') + ->assertOk() + ->getContent(); + + // Blade: @checked(...) will output checked="checked" + $this->assertStringContainsString('name="bmpa_processable_only" value="1" checked', $html); + } +}