From 70572291123c3db5858966cfc91d6d76beebfb65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Sun, 15 Mar 2026 18:14:50 +0800 Subject: [PATCH] =?UTF-8?q?test(admin):=20=E4=BB=AA=E8=A1=A8=E7=9B=98=20An?= =?UTF-8?q?alysis=20=E9=AA=A8=E6=9E=B6=E7=BB=93=E6=9E=84=E6=8A=A4=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rdShouldHaveAnalysisLayoutSkeletonTest.php | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 tests/Feature/AdminDashboardShouldHaveAnalysisLayoutSkeletonTest.php diff --git a/tests/Feature/AdminDashboardShouldHaveAnalysisLayoutSkeletonTest.php b/tests/Feature/AdminDashboardShouldHaveAnalysisLayoutSkeletonTest.php new file mode 100644 index 0000000..fe034d3 --- /dev/null +++ b/tests/Feature/AdminDashboardShouldHaveAnalysisLayoutSkeletonTest.php @@ -0,0 +1,41 @@ +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); + } +}