Fix: dashboard recent platform orders table overflow

This commit is contained in:
萝卜
2026-03-16 23:54:54 +08:00
parent 131aa6b259
commit c54e95bb74
2 changed files with 68 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminDashboardRecentPlatformOrdersTableLayoutShouldBeFixedToPreventOverflowTest 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_recent_platform_orders_table_should_have_fixed_layout_guard(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin');
$res->assertOk();
// 结构护栏:最近平台订单 table 必须可被稳定选择
$res->assertSee('data-role="recent-platform-orders-table"', false);
$css = (string) file_get_contents(public_path('css/admin-components.css'));
// CSS 护栏:必须启用 table-layout:fixed避免长内容把列宽撑破导致横向溢出。
$this->assertStringContainsString('[data-role="recent-platform-orders-table"]{', $css);
$this->assertStringContainsString('table-layout:fixed', $css);
}
}