测试: 仪表盘迷你图复用表格链接选择器护栏
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminJsDashboardMiniChartsShouldReuseTableLinksSelectorsTest extends TestCase
|
||||
{
|
||||
public function test_admin_js_dashboard_mini_charts_should_reuse_table_links_selectors(): void
|
||||
{
|
||||
$js = (string) file_get_contents(public_path('js/admin.js'));
|
||||
|
||||
// 趋势:复用日期表格链接
|
||||
$this->assertStringContainsString('[data-role="platform-order-trend-7d"] a.link', $js);
|
||||
|
||||
// 排行:复用站点表格链接(按 merchant_id 提取)
|
||||
$this->assertStringContainsString('[data-role="merchant-revenue-rank-7d"] a.link[href*="merchant_id="]', $js);
|
||||
|
||||
// 占比:复用套餐表格链接(按 plan_id 提取)
|
||||
$this->assertStringContainsString('[data-role="plan-order-share-top5"] a.link[href*="plan_id="]', $js);
|
||||
|
||||
// 渐进增强:可点击则 <a>
|
||||
$this->assertStringContainsString("document.createElement(href ? 'a' : 'div')", $js);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user