Files
saasshop/tests/Feature/AdminJsMerchantRevenueRank7dShouldParseMerchantIdFromLinksMapTest.php

19 lines
726 B
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 Tests\TestCase;
class AdminJsMerchantRevenueRank7dShouldParseMerchantIdFromLinksMapTest extends TestCase
{
public function test_admin_js_merchant_revenue_rank_7d_should_parse_merchant_id_from_links_map(): void
{
$js = (string) file_get_contents(public_path('js/admin.js'));
// 护栏:应从表格链接中解析 merchant_id而不是用 href*="merchant_id=ID" 做模糊匹配
$this->assertStringContainsString('[data-role="merchant-revenue-rank-7d"] a.link[href*="merchant_id="]', $js);
$this->assertStringContainsString('href.match(/[?&]merchant_id=(\\d+)/)', $js);
$this->assertStringContainsString('merchantIdToHref', $js);
}
}