Files
saasshop/tests/Feature/AdminSiteSubscriptionIndexExpiryGovernanceBlockTest.php

39 lines
1.0 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 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天内到期');
}
}