admin ui: make filter-error use theme error tokens

This commit is contained in:
萝卜
2026-03-16 00:40:43 +08:00
parent 8d629e9dbb
commit 4754f8379d
2 changed files with 41 additions and 4 deletions

View File

@@ -0,0 +1,37 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminBaseCssFilterErrorShouldUseThemeErrorTokensTest 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_filter_error_should_use_theme_error_tokens(): void
{
$this->loginAsPlatformAdmin();
$css = file_get_contents(public_path('css/admin-base.css'));
$this->assertIsString($css);
// filter-error 属于错误提示组件,应引用主题错误令牌(便于全站统一风格)
$this->assertStringContainsString('.filter-error{', $css);
$this->assertStringContainsString('background:var(--adm-error-bg', $css);
$this->assertStringContainsString('color:var(--adm-error', $css);
// 不应再硬编码旧的暗红色文本(#991b1b
$this->assertStringNotContainsString('#991b1b', $css);
}
}