chore(admin-ui): stop loading legacy admin.css and enforce new css stack
This commit is contained in:
37
tests/Feature/AdminLayoutShouldNotLoadLegacyAdminCssTest.php
Normal file
37
tests/Feature/AdminLayoutShouldNotLoadLegacyAdminCssTest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminLayoutShouldNotLoadLegacyAdminCssTest 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_layout_should_not_load_legacy_admin_css(): void
|
||||
{
|
||||
$this->loginAsPlatformAdmin();
|
||||
|
||||
$response = $this->get('/admin');
|
||||
$response->assertOk();
|
||||
|
||||
// legacy admin.css 是旧的暗色风格压缩文件,会覆盖新的 token 化样式体系。
|
||||
$response->assertDontSee('/css/admin.css', false);
|
||||
|
||||
// 新的样式体系必须加载。
|
||||
$response->assertSee('/css/admin-theme.css', false);
|
||||
$response->assertSee('/css/admin-base.css', false);
|
||||
$response->assertSee('/css/admin-components.css', false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminLoginPageShouldLoadNewAdminCssStackTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_admin_login_page_should_load_new_admin_css_stack(): void
|
||||
{
|
||||
$response = $this->get('/admin/login');
|
||||
$response->assertOk();
|
||||
|
||||
// login 页面也要走 token 化样式栈,避免被 legacy admin.css 暗色风格污染。
|
||||
$response->assertDontSee('/css/admin.css', false);
|
||||
$response->assertSee('/css/admin-theme.css', false);
|
||||
$response->assertSee('/css/admin-base.css', false);
|
||||
$response->assertSee('/css/admin-components.css', false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user