fix(admin-dashboard): prevent pay column header wrap
This commit is contained in:
@@ -758,6 +758,13 @@
|
||||
margin-right:4px;
|
||||
}
|
||||
|
||||
/* 仪表盘最近订单:避免「支付」表头在窄宽下被拆成竖排(CJK 可在任意字间断行) */
|
||||
[data-page="admin.dashboard"] [data-role="recent-platform-orders-table"] th:nth-child(4),
|
||||
[data-page="admin.dashboard"] [data-role="recent-platform-orders-table"] td:nth-child(4){
|
||||
white-space:nowrap;
|
||||
min-width:56px;
|
||||
}
|
||||
|
||||
/* 仪表盘最近订单:扫描信息行(用于快速判断治理状态,不替代下方治理提示入口) */
|
||||
[data-page="admin.dashboard"] .adm-order-scanline{
|
||||
margin-top:3px;
|
||||
|
||||
@@ -307,7 +307,7 @@
|
||||
<a class="muted" href="{!! $platformOrdersIndexUrl !!}">查看全部</a>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<table data-role="recent-platform-orders-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>订单号</th>
|
||||
|
||||
@@ -26,8 +26,13 @@ class AdminDashboardRecentPlatformOrderLinksShouldCarryBackTest extends TestCase
|
||||
$res = $this->get('/admin');
|
||||
$res->assertOk();
|
||||
|
||||
$html = (string) $res->getContent();
|
||||
|
||||
// 从仪表盘点进订单详情后,应能通过 back 回到 /admin
|
||||
$res->assertSee('href="/admin/platform-orders/1?back=%2Fadmin"', false);
|
||||
// 备注:订单 ID 不应被测试写死(seed 数据可能调整)。这里只校验“任意一条详情链接”携带 back=%2Fadmin。
|
||||
$this->assertMatchesRegularExpression('/href="\\/admin\\/platform-orders\\/\\d+\\?back=%2Fadmin"/', $html);
|
||||
|
||||
// back 必须是一次性的(避免 nested back / HTML & 泄露)
|
||||
$res->assertDontSee('&back=', false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminDashboardRecentPlatformOrdersPayColumnShouldNotWrapTest 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_pay_column_should_have_nowrap_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 护栏:第 4 列(支付)必须明确 nowrap + min-width
|
||||
$this->assertStringContainsString('[data-role="recent-platform-orders-table"] th:nth-child(4)', $css);
|
||||
$this->assertStringContainsString('white-space:nowrap', $css);
|
||||
$this->assertStringContainsString('min-width:56px', $css);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user