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