chore(admin-ui): tokenise popover shadow and surface tint

This commit is contained in:
萝卜
2026-03-16 02:24:09 +08:00
parent a8845422aa
commit 9c6756e991
4 changed files with 74 additions and 3 deletions

View File

@@ -0,0 +1,35 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminComponentsCssShouldUsePopoverShadowAndSurfaceTintTokensTest 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_components_css_should_use_popover_shadow_and_surface_tint_tokens(): void
{
$this->loginAsPlatformAdmin();
$css = file_get_contents(public_path('css/admin-components.css'));
$this->assertIsString($css);
// popover/toast/dropdown 的阴影应走 token。
$this->assertStringContainsString('var(--adm-shadow-popover', $css);
// 列表空态背景应走 surface token。
$this->assertStringContainsString('var(--adm-surface-tint', $css);
}
}

View File

@@ -0,0 +1,32 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminThemeCssShouldDefinePopoverShadowAndSurfaceTintTokensTest 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_theme_css_should_define_popover_shadow_and_surface_tint_tokens(): void
{
$this->loginAsPlatformAdmin();
$css = file_get_contents(public_path('css/admin-theme.css'));
$this->assertIsString($css);
$this->assertStringContainsString('--adm-shadow-popover', $css);
$this->assertStringContainsString('--adm-surface-tint', $css);
}
}