chore(admin-dashboard): enrich trend bar tooltip with avg paid

This commit is contained in:
萝卜
2026-03-16 13:42:51 +08:00
parent ca05122c2c
commit 0f07fe7c8b
2 changed files with 40 additions and 2 deletions

View File

@@ -0,0 +1,34 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminDashboardTrendMiniChartTooltipShouldIncludeAvgTest 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_trend_bar_tooltip_should_include_avg_paid_per_order(): void
{
$this->loginAsPlatformAdmin();
$this->get('/admin')->assertOk();
$js = (string) file_get_contents(public_path('js/admin.js'));
// 护栏:趋势 bar 的 tooltip 应包含“单均”口径(更便于运营理解波动)
$this->assertStringContainsString("'|单均 ¥'", $js);
$this->assertStringContainsString('formatMoney(avg)', $js);
}
}