Files
saasshop/tests/Feature/AdminDashboardRowWarnStyleShouldBeScopedTest.php

22 lines
923 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace Tests\Feature;
use Tests\TestCase;
class AdminDashboardRowWarnStyleShouldBeScopedTest extends TestCase
{
public function test_admin_dashboard_row_warn_style_should_be_scoped(): void
{
$css = (string) file_get_contents(public_path('css/admin-components.css'));
// 仪表盘最近订单也使用 row-warn/row-warn-prefix但必须“按页面范围”提供样式避免依赖平台订单列表页的 table scope。
$this->assertStringContainsString('[data-page="admin.dashboard"] .row-warn{', $css);
$this->assertStringContainsString('[data-page="admin.dashboard"] .row-warn-prefix{', $css);
// 保持治理:禁止出现全局 .row-warn{...} 或 .row-warn-prefix{...},避免污染其它页面。
$this->assertStringNotContainsString("\n.row-warn{", $css);
$this->assertStringNotContainsString("\n.row-warn-prefix{", $css);
}
}