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