feat(admin): 站点管理页补齐订阅/平台订单/续费缺订阅治理入口 + back

This commit is contained in:
萝卜
2026-03-15 08:25:44 +00:00
parent 765195e7f3
commit 3b5cb6ede7
2 changed files with 80 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
<?php
namespace Tests\Feature;
use App\Models\Merchant;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminMerchantIndexGovernanceLinksShouldIncludeRenewalMissingSubscriptionTest 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_merchants_index_should_include_governance_links_with_back(): void
{
$this->loginAsPlatformAdmin();
$merchant = Merchant::query()->firstOrFail();
$res = $this->get('/admin/merchants');
$res->assertOk();
$html = (string) $res->getContent();
// 站点治理入口:订阅/平台订单/续费缺订阅
$this->assertStringContainsString('/admin/site-subscriptions?merchant_id=' . $merchant->id, $html);
$this->assertStringContainsString('/admin/platform-orders?merchant_id=' . $merchant->id, $html);
$this->assertStringContainsString('renewal_missing_subscription=1', $html);
// back 应回到站点管理页
$this->assertStringContainsString('back=' . urlencode('/admin/merchants'), $html);
}
}