42 lines
1.2 KiB
PHP
42 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Tests\TestCase;
|
|
|
|
class AdminDashboardShouldHaveAnalysisLayoutSkeletonTest 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_have_analysis_layout_skeleton(): void
|
|
{
|
|
$this->loginAsPlatformAdmin();
|
|
|
|
$res = $this->get('/admin');
|
|
$res->assertOk();
|
|
|
|
$html = (string) $res->getContent();
|
|
|
|
// PageHeader + KPI row
|
|
$this->assertStringContainsString('data-page="admin.dashboard"', $html);
|
|
$this->assertStringContainsString('class="page-header', $html);
|
|
$this->assertStringContainsString('class="kpi-grid', $html);
|
|
|
|
// Analysis 版式占位:趋势 + 排行(后续再接真实聚合数据)
|
|
$this->assertStringContainsString('data-role="analysis-skeleton"', $html);
|
|
$this->assertStringContainsString('趋势', $html);
|
|
$this->assertStringContainsString('排行', $html);
|
|
}
|
|
}
|