ui(site-subscriptions): add ends_at range quick links

This commit is contained in:
萝卜
2026-03-17 06:13:56 +08:00
parent 0d36cb7989
commit f39fb9ebcd
2 changed files with 59 additions and 1 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminSiteSubscriptionIndexEndsAtRangeQuickLinksShouldRenderTest 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_site_subscriptions_index_should_render_ends_at_range_quick_links(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin/site-subscriptions');
$res->assertOk();
$html = (string) $res->getContent();
$this->assertStringContainsString('今天到期', $html);
$this->assertStringContainsString('近7天到期', $html);
$this->assertStringContainsString('近30天到期', $html);
$this->assertStringContainsString('清空到期区间', $html);
$this->assertStringContainsString('ends_from=', $html);
$this->assertStringContainsString('ends_to=', $html);
}
}