Files
saasshop/tests/Feature/AdminOrdersIndexSectionDarkShouldUseSurfaceTintTest.php

39 lines
1.1 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 AdminOrdersIndexSectionDarkShouldUseSurfaceTintTest 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_orders_index_should_not_use_hardcoded_dark_section_background(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin/orders');
$res->assertOk();
// 页面仍然可以使用 section-dark 作为“强调区块”类名,但样式不应回到深色背景
$res->assertSee('section-dark', false);
$css = (string) file_get_contents(public_path('css/admin-base.css'));
// 旧版硬编码深色背景background:#0f172a
$this->assertStringNotContainsString('background:#0f172a', $css);
$this->assertStringContainsString('--adm-surface-tint', $css);
}
}