feat(admin): 仪表盘 KPI 卡可点击并携带 back 回跳

This commit is contained in:
萝卜
2026-03-15 19:27:00 +08:00
parent 2f0c3ca11b
commit 1514700b87
2 changed files with 49 additions and 4 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminDashboardKpiCardsShouldLinkToListsWithBackTest 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_kpi_cards_should_link_to_lists_with_back(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin');
$res->assertOk();
$res->assertSee('href="/admin/merchants?back=%2Fadmin"', false);
$res->assertSee('href="/admin/plans?back=%2Fadmin"', false);
$res->assertSee('href="/admin/site-subscriptions?back=%2Fadmin"', false);
$res->assertSee('href="/admin/platform-orders?back=%2Fadmin"', false);
$res->assertDontSee('&amp;back=', false);
}
}