From 61cb61da6aad77882b1b4484532f235fc55caf88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Thu, 19 Mar 2026 05:45:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E9=BD=90=E5=B9=B3=E5=8F=B0=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=B7=A5=E5=85=B7=E5=88=86=E7=BB=84=E8=AF=AD=E4=B9=89?= =?UTF-8?q?=E6=8A=A4=E6=A0=8F=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oupsShouldHaveDataRoleAndAriaLabelTest.php | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tests/Feature/AdminPlatformOrderIndexToolGroupsShouldHaveDataRoleAndAriaLabelTest.php diff --git a/tests/Feature/AdminPlatformOrderIndexToolGroupsShouldHaveDataRoleAndAriaLabelTest.php b/tests/Feature/AdminPlatformOrderIndexToolGroupsShouldHaveDataRoleAndAriaLabelTest.php new file mode 100644 index 0000000..f76f3d7 --- /dev/null +++ b/tests/Feature/AdminPlatformOrderIndexToolGroupsShouldHaveDataRoleAndAriaLabelTest.php @@ -0,0 +1,48 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_platform_orders_index_tool_groups_should_have_data_role_and_aria_label(): void + { + $this->loginAsPlatformAdmin(); + + $res = $this->get('/admin/platform-orders'); + $res->assertOk(); + + $html = (string) $res->getContent(); + + $this->assertStringContainsString('data-role="po-tools-grid"', $html); + $this->assertStringContainsString('aria-label="平台订单工具区网格"', $html); + + $expectedGroups = [ + 'po-tools-group-export' => '平台订单导出工具组', + 'po-tools-group-batch-activate-subscriptions' => '平台订单批量同步订阅工具组', + 'po-tools-group-batch-bmpa' => '平台订单批量标记支付并生效工具组', + 'po-tools-group-batch-mark-activated' => '平台订单批量仅标记为已生效工具组', + 'po-tools-group-clear-sync-errors' => '平台订单清理同步失败标记工具组', + 'po-tools-group-clear-bmpa-errors' => '平台订单清理批量BMPA失败标记工具组', + ]; + + foreach ($expectedGroups as $role => $ariaLabel) { + $this->assertStringContainsString("data-role=\"{$role}\"", $html); + $this->assertStringContainsString("aria-label=\"{$ariaLabel}\"", $html); + } + } +}