chore(admin-ui): tokenise popover shadow and surface tint
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user