admin-components: normalize platform orders css formatting (maintainable)

This commit is contained in:
萝卜
2026-03-14 13:37:23 +00:00
parent b14ad40a8a
commit 26f283d283
2 changed files with 86 additions and 11 deletions

View File

@@ -0,0 +1,35 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminComponentsCssPlatformOrdersFormattingTest 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_contains_platform_orders_blocks_with_braced_formatting(): void
{
$this->loginAsPlatformAdmin();
$css = file_get_contents(public_path('css/admin-components.css'));
$this->assertIsString($css);
// 轻量格式存在性断言:平台订单列表相关 selector 应使用多行块格式,便于长期维护
$this->assertStringContainsString(".platform-orders-table .col-optional{\n", $css);
$this->assertStringContainsString(".platform-orders-table.is-full .col-optional{\n", $css);
$this->assertStringContainsString(".platform-orders-table .row-warn{\n", $css);
$this->assertStringContainsString(".platform-orders-table .row-warn-prefix{\n", $css);
}
}