feat(admin): 仪表盘最近平台订单链接携带 back 回跳

This commit is contained in:
萝卜
2026-03-15 19:16:51 +08:00
parent 52a889712a
commit 7f59bb9985
2 changed files with 38 additions and 2 deletions

View File

@@ -0,0 +1,33 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminDashboardRecentPlatformOrderLinksShouldCarryBackTest 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_recent_platform_order_links_should_carry_back(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin');
$res->assertOk();
// 从仪表盘点进订单详情后,应能通过 back 回到 /admin
$res->assertSee('href="/admin/platform-orders/1?back=%2Fadmin"', false);
$res->assertDontSee('&amp;back=', false);
}
}