Files
saasshop/tests/Feature/AdminComponentsCssListCardTableShouldUseThemeTableTokensTest.php

37 lines
1.2 KiB
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 AdminComponentsCssListCardTableShouldUseThemeTableTokensTest 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_list_card_table_should_use_theme_table_tokens(): void
{
$this->loginAsPlatformAdmin();
$css = file_get_contents(public_path('css/admin-components.css'));
$this->assertIsString($css);
// 表头背景与 hover 背景必须走主题 token便于统一风格与后续换肤。
$this->assertStringContainsString('.list-card-table thead th{', $css);
$this->assertStringContainsString('background:var(--adm-table-header-bg, #fafafa)', $css);
$this->assertStringContainsString('.list-card-table tbody tr:hover td{', $css);
$this->assertStringContainsString('background:var(--adm-table-row-hover-bg, rgba(22, 119, 255, .04))', $css);
}
}