<?php

namespace Tests\Feature;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

class AdminPlatformOrderIndexRowWarnStyleTokenTest extends TestCase
{
    use RefreshDatabase;

    protected function loginAsPlatformAdmin(): void
    {
        $this->seed();

        $this->post('/admin/login', [
            'email' => 'platform.admin@demo.local',
            'password' => 'Platform@123456',
        ])->assertRedirect('/admin');
    }

    public function test_row_warn_style_tokens_exist_in_css(): void
    {
        $this->loginAsPlatformAdmin();

        $css = file_get_contents(public_path('css/admin-components.css'));
        $this->assertIsString($css);

        // 只做轻量 token 断言：确保 row-warn 仍是“浅底 + 左边框”提示条
        $this->assertStringContainsString('.platform-orders-table .row-warn{', $css);
        $this->assertStringContainsString('border-left:3px solid', $css);
        $this->assertStringContainsString('background:#fff9f9', $css);
    }
}
