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); + } +}