fix(admin-js): merchant revenue rank bars use ratio (no undefined barRatio)
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminJsMerchantRevenueRank7dChartShouldNotUseUndefinedBarRatioTest extends TestCase
|
||||
{
|
||||
public function test_admin_js_merchant_revenue_rank_7d_chart_should_not_use_undefined_bar_ratio(): void
|
||||
{
|
||||
$js = (string) file_get_contents(public_path('js/admin.js'));
|
||||
|
||||
// 保护:Top5 站点收入排行条形图应使用 ratio 变量(paid/max),不应引用 barRatio。
|
||||
$this->assertStringContainsString(
|
||||
"bar.className = 'adm-mini-rank-bar';\n bar.style.width = Math.round(ratio * 100)",
|
||||
$js
|
||||
);
|
||||
|
||||
$this->assertStringNotContainsString(
|
||||
"bar.className = 'adm-mini-rank-bar';\n bar.style.width = Math.round(barRatio * 100)",
|
||||
$js
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user