Files
saasshop/tests/Feature/AdminBaseCssShouldUseLightThemeTokensTest.php

39 lines
1.3 KiB
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 Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminBaseCssShouldUseLightThemeTokensTest 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_should_use_light_theme_tokens(): void
{
$this->loginAsPlatformAdmin();
$css = file_get_contents(public_path('css/admin-base.css'));
$this->assertIsString($css);
// 核心body 文本应引用 --adm-text浅色主题为深色文字避免仍残留暗色文字默认值
$this->assertStringContainsString('color:var(--adm-text, #0f172a)', $css);
// 表格分割线应引用 --adm-border-color浅色主题为浅边框避免仍硬编码 #334155
$this->assertStringContainsString('border-bottom:1px solid var(--adm-border-color', $css);
// 表单 focus 需要有主色描边Ant Design Pro 关键交互反馈)
$this->assertStringContainsString('box-shadow:0 0 0 3px rgba(22, 119, 255, .12)', $css);
}
}