Files
saasshop/tests/Feature/AdminComponentsCssTopnavHoverShouldUsePrimaryTintTokenTest.php

34 lines
999 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminComponentsCssTopnavHoverShouldUsePrimaryTintTokenTest 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_topnav_hover_should_use_primary_tint_token(): void
{
$this->loginAsPlatformAdmin();
$css = file_get_contents(public_path('css/admin-components.css'));
$this->assertIsString($css);
// 顶部导航 hover 高亮必须走 primary tint token避免散落 rgba 硬编码。
$this->assertStringContainsString('.topnav-link:hover', $css);
$this->assertStringContainsString('background:var(--adm-primary-tint-08', $css);
}
}