chore(admin-ui): migrate platform leads index to filters/list card and admin pagination

This commit is contained in:
萝卜
2026-03-16 03:34:48 +08:00
parent d5c14bd741
commit 1e64bbc6d3
2 changed files with 183 additions and 124 deletions

View File

@@ -0,0 +1,45 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformLeadsIndexShouldUseFiltersAndListCardStructureTest 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_admin_platform_leads_index_should_use_filters_and_list_card_structure(): void
{
$this->loginAsPlatformAdmin();
$response = $this->get('/admin/platform-leads');
$response->assertOk();
// 护栏:线索列表页应使用统一 Filters Card + List Card 结构,便于全站后台观感一致。
$response->assertSee('filters-card', false);
$response->assertSee('filters-summary', false);
$response->assertSee('filters-body', false);
$response->assertSee('filters-grid', false);
$response->assertSee('list-card', false);
$response->assertSee('list-card-header', false);
$response->assertSee('list-card-body', false);
$response->assertSee('list-card-table', false);
// 分页统一:此页数据量可能不足导致 hasPages=false因此用扫描型护栏断言。
$blade = file_get_contents(resource_path('views/admin/platform_leads/index.blade.php'));
$this->assertIsString($blade);
$this->assertStringContainsString("links('pagination.admin')", $blade);
}
}