test(admin-dashboard): guard mini charts containers
This commit is contained in:
34
tests/Feature/AdminDashboardMiniChartsShouldRenderTest.php
Normal file
34
tests/Feature/AdminDashboardMiniChartsShouldRenderTest.php
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user