38 lines
1.0 KiB
PHP
38 lines
1.0 KiB
PHP
<?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);
|
|
}
|
|
}
|