<?php

namespace Tests\Feature;

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

class AdminBaseCssInfoWarningShouldUseThemeWarningTokensTest 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_admin_base_css_info_warning_should_use_theme_warning_tokens(): void
    {
        $this->loginAsPlatformAdmin();

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

        // info-warning 属于提示条，应引用 warning 主题令牌（颜色/背景/圆角统一）
        $this->assertStringContainsString('.info-warning{', $css);
        $this->assertStringContainsString('color:var(--adm-warning', $css);
        $this->assertStringContainsString('background:var(--adm-warning-bg', $css);
        $this->assertStringContainsString('border-radius:var(--adm-radius-sm', $css);

        // 不应再硬编码旧的 border-color（文字色在其它类中仍可能出现，这里只约束 info-warning 组件本身）
        $this->assertStringNotContainsString('border:1px solid #f59e0b', $css);
    }
}
