Admin dashboard: add billing workbench entry and quick links

This commit is contained in:
萝卜
2026-03-15 00:43:04 +00:00
parent 6d1364bcf1
commit d76a50e37c
3 changed files with 104 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminDashboardBillingWorkbenchLinksTest 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_should_render_billing_workbench_links(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin');
$res->assertOk();
$res->assertSee('收费工作台');
$res->assertSee('href="/admin/platform-orders"', false);
$res->assertSee('进入平台订单');
$res->assertSee('href="/admin/site-subscriptions"', false);
$res->assertSee('进入订阅管理');
$res->assertSee('href="/admin/plans"', false);
$res->assertSee('进入套餐管理');
}
}

View File

@@ -0,0 +1,43 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminDashboardBillingWorkbenchQuickLinksTest 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_should_render_billing_workbench_quick_links(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin');
$res->assertOk();
$res->assertSee('快捷筛选');
$res->assertSee('href="/admin/platform-orders?payment_status=unpaid&status=pending"', false);
$res->assertSee('待支付');
$res->assertSee('href="/admin/platform-orders?payment_status=paid&status=pending"', false);
$res->assertSee('待生效');
$res->assertSee('href="/admin/platform-orders?syncable_only=1"', false);
$res->assertSee('可同步');
$res->assertSee('href="/admin/platform-orders?sync_status=failed"', false);
$res->assertSee('同步失败');
}
}