From c692e099aa569a6747f695adf2703af5fda963f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Tue, 17 Mar 2026 14:45:02 +0800 Subject: [PATCH] fix(admin): include batch run_id filters in hidden inputs partial --- .../filters_hidden_inputs.blade.php | 2 ++ ...ddenInputsShouldIncludeBatchRunIdsTest.php | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tests/Feature/AdminPlatformOrderIndexToolFormsHiddenInputsShouldIncludeBatchRunIdsTest.php diff --git a/resources/views/admin/components/filters_hidden_inputs.blade.php b/resources/views/admin/components/filters_hidden_inputs.blade.php index a19d4db..c5f1665 100644 --- a/resources/views/admin/components/filters_hidden_inputs.blade.php +++ b/resources/views/admin/components/filters_hidden_inputs.blade.php @@ -25,6 +25,8 @@ 'syncable_only', 'renewal_missing_subscription', 'batch_synced_24h', + 'batch_activation_run_id', + 'batch_bmpa_run_id', 'batch_mark_paid_and_activate_24h', 'batch_mark_activated_24h', 'keyword', diff --git a/tests/Feature/AdminPlatformOrderIndexToolFormsHiddenInputsShouldIncludeBatchRunIdsTest.php b/tests/Feature/AdminPlatformOrderIndexToolFormsHiddenInputsShouldIncludeBatchRunIdsTest.php new file mode 100644 index 0000000..2aecee6 --- /dev/null +++ b/tests/Feature/AdminPlatformOrderIndexToolFormsHiddenInputsShouldIncludeBatchRunIdsTest.php @@ -0,0 +1,34 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_tool_forms_hidden_inputs_should_include_batch_run_ids_when_present(): void + { + $this->loginAsPlatformAdmin(); + + $html = $this->get('/admin/platform-orders?batch_activation_run_id=BAS_TEST_0001&batch_bmpa_run_id=BMPA_TEST_0001') + ->assertOk() + ->getContent(); + + // 过滤器 hidden inputs 组件应能透传新加的两个 run_id 字段 + $this->assertStringContainsString('name="batch_activation_run_id" value="BAS_TEST_0001"', $html); + $this->assertStringContainsString('name="batch_bmpa_run_id" value="BMPA_TEST_0001"', $html); + } +}