Subscriptions: add expiry governance block on index

This commit is contained in:
萝卜
2026-03-15 00:55:09 +00:00
parent 85a3189e81
commit a88a07755b
2 changed files with 55 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminSiteSubscriptionIndexExpiryGovernanceBlockTest 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_index_should_render_expiry_governance_block_with_quick_links(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin/site-subscriptions');
$res->assertOk();
$res->assertSee('到期治理');
// 链接应使用 quick filter仅 expiry不附带 status
$res->assertSee('href="/admin/site-subscriptions?expiry=expired"', false);
$res->assertSee('href="/admin/site-subscriptions?expiry=expiring_7d"', false);
$res->assertSee('已过期');
$res->assertSee('7天内到期');
}
}