admin-components: scope table-wrap min-width rule to platform-orders-table

This commit is contained in:
萝卜
2026-03-14 13:42:57 +00:00
parent 9944e7221f
commit 5d1912ae8a
2 changed files with 35 additions and 1 deletions

View File

@@ -81,7 +81,7 @@
overflow-x:auto;
}
.table-wrap table{
.table-wrap table.platform-orders-table{
min-width:1600px;
}

View File

@@ -0,0 +1,34 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminComponentsCssTableWrapScopeTest 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_table_wrap_min_width_rule_is_scoped_to_platform_orders_table(): void
{
$this->loginAsPlatformAdmin();
$css = file_get_contents(public_path('css/admin-components.css'));
$this->assertIsString($css);
$this->assertStringContainsString('.table-wrap table.platform-orders-table{', $css);
// 避免对所有 table-wrap 下的 table 生效(影响其它页面表格)
$this->assertStringNotContainsString("\n.table-wrap table{", $css);
}
}