23 lines
759 B
PHP
23 lines
759 B
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use Tests\TestCase;
|
|
|
|
class AdminJsMerchantRevenueRank7dShouldFindTableLinkByMerchantIdSelectorTest extends TestCase
|
|
{
|
|
public function test_admin_js_merchant_revenue_rank_7d_should_find_table_link_by_merchant_id_selector(): void
|
|
{
|
|
$js = (string) file_get_contents(public_path('js/admin.js'));
|
|
|
|
// 护栏:迷你排行应尝试从表格中复用 merchant_id 的链接(避免硬编码 URL 口径)
|
|
$this->assertStringContainsString(
|
|
'[data-role="merchant-revenue-rank-7d"] a.link[href*="merchant_id=',
|
|
$js
|
|
);
|
|
|
|
// 且会把行渲染为 a/div 二选一
|
|
$this->assertStringContainsString("document.createElement(href ? 'a' : 'div')", $js);
|
|
}
|
|
}
|