Files
saasshop/tests/Feature/AdminDashboardPlanOrderSharePlanLinkShouldCarryBackTest.php

39 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminDashboardPlanOrderSharePlanLinkShouldCarryBackTest 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_plan_link_should_carry_back(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin');
$res->assertOk();
// 套餐占比表格里,点击套餐名应跳到平台订单列表并带 back 回到仪表盘
// 并且应携带同口径的近7天范围与排行卡一致避免用户从“近7天占比”跳过去却看到全量。
$res->assertSee('href="/admin/platform-orders?plan_id=1&created_from=', false);
$res->assertSee('&created_to=', false);
$res->assertSee('&back=%2Fadmin"', false);
// 不应出现 &amp;back=,避免回跳断链
$res->assertDontSee('&amp;back=', false);
}
}