test(admin-dashboard): guard mini charts containers

This commit is contained in:
萝卜
2026-03-16 10:30:48 +08:00
parent 765f79fe87
commit d2b06e5872

View File

@@ -0,0 +1,34 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminDashboardMiniChartsShouldRenderTest 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_dashboard_should_render_mini_charts_containers(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin');
$res->assertOk();
// 图形化护栏:确保三个渐进增强容器存在(趋势 / 排行 / 占比)
$res->assertSee('data-role="platform-order-trend-7d-chart"', false);
$res->assertSee('data-role="merchant-revenue-rank-7d-chart"', false);
$res->assertSee('data-role="plan-order-share-top5-chart"', false);
}
}