feat(admin): 仪表盘最近订单查看全部链接携带 back
This commit is contained in:
@@ -117,7 +117,10 @@
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="flex-between">
|
<div class="flex-between">
|
||||||
<h3 class="mt-0">最近平台订单</h3>
|
<h3 class="mt-0">最近平台订单</h3>
|
||||||
<a class="muted" href="/admin/platform-orders">查看全部</a>
|
@php
|
||||||
|
$platformOrdersIndexUrl = \App\Support\BackUrl::withBack('/admin/platform-orders', $selfWithoutBack);
|
||||||
|
@endphp
|
||||||
|
<a class="muted" href="{!! $platformOrdersIndexUrl !!}">查看全部</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class AdminDashboardRecentPlatformOrdersViewAllLinkShouldCarryBackTest 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_orders_view_all_link_should_carry_back(): void
|
||||||
|
{
|
||||||
|
$this->loginAsPlatformAdmin();
|
||||||
|
|
||||||
|
$res = $this->get('/admin');
|
||||||
|
$res->assertOk();
|
||||||
|
|
||||||
|
$res->assertSee('href="/admin/platform-orders?back=%2Fadmin"', false);
|
||||||
|
$res->assertDontSee('&back=', false);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user