Files
saasshop/tests/Feature/AdminDashboardRecentPlatformOrdersTableLayoutShouldBeFixedToPreventOverflowTest.php

39 lines
1.2 KiB
PHP
Raw 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 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);
}
}