From 2b692497e76175283291e421d022741217929d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Sat, 14 Mar 2026 13:17:11 +0000 Subject: [PATCH] admin-components: style row-warn hint as subtle alert and assert scoping --- public/css/admin-components.css | 2 +- ...atformOrderIndexRowWarnStyleScopedTest.php | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 tests/Feature/AdminPlatformOrderIndexRowWarnStyleScopedTest.php diff --git a/public/css/admin-components.css b/public/css/admin-components.css index c7483ac..a3ef392 100644 --- a/public/css/admin-components.css +++ b/public/css/admin-components.css @@ -90,7 +90,7 @@ .platform-orders-table.is-compact td{padding-top:8px;padding-bottom:8px;} .platform-orders-table.is-compact .muted-xs{font-size:12px;} .platform-orders-table .row-meta{margin-top:2px;} -.platform-orders-table .row-warn{margin-top:4px;} +.platform-orders-table .row-warn{margin-top:4px;padding:4px 6px;border-left:3px solid #d9534f;background:#fff6f6;border-radius:4px;} /* 平台订单列表:精简视图也要可达的治理提示(对账/退款不一致) */ .platform-orders-table .governance-hints{margin-bottom:6px;} diff --git a/tests/Feature/AdminPlatformOrderIndexRowWarnStyleScopedTest.php b/tests/Feature/AdminPlatformOrderIndexRowWarnStyleScopedTest.php new file mode 100644 index 0000000..3d45951 --- /dev/null +++ b/tests/Feature/AdminPlatformOrderIndexRowWarnStyleScopedTest.php @@ -0,0 +1,35 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_row_warn_style_is_scoped_under_platform_orders_table_only(): void + { + $this->loginAsPlatformAdmin(); + + // 通过直接读取 CSS 内容做“范围约束”断言:必须以 .platform-orders-table 开头,避免全局污染 + $css = file_get_contents(public_path('css/admin-components.css')); + + $this->assertIsString($css); + $this->assertStringContainsString('.platform-orders-table .row-warn{', $css); + + // 仅避免“全局 .row-warn{...}”这种写法(会污染其它页面)。 + $this->assertStringNotContainsString("\n.row-warn{", $css); + } +}