feat: dashboard plans link should carry back
This commit is contained in:
@@ -178,7 +178,10 @@
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="flex-between">
|
<div class="flex-between">
|
||||||
<h3 class="mt-0">套餐订单占比(Top5)</h3>
|
<h3 class="mt-0">套餐订单占比(Top5)</h3>
|
||||||
<a class="muted" href="/admin/plans">查看套餐</a>
|
@php
|
||||||
|
$plansIndexUrl = \App\Support\BackUrl::withBack('/admin/plans', $selfWithoutBack);
|
||||||
|
@endphp
|
||||||
|
<a class="muted" href="{!! $plansIndexUrl !!}">查看套餐</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@php
|
@php
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class AdminDashboardPlanOrderShareViewPlansLinkShouldCarryBackTest 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_plan_order_share_view_plans_link_should_carry_back(): void
|
||||||
|
{
|
||||||
|
$this->loginAsPlatformAdmin();
|
||||||
|
|
||||||
|
$res = $this->get('/admin');
|
||||||
|
$res->assertOk();
|
||||||
|
|
||||||
|
$res->assertSee('href="/admin/plans?back=%2Fadmin"', false);
|
||||||
|
$res->assertDontSee('&back=', false);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user