chore(admin-ui): migrate product import histories to filters/list card and admin pagination

This commit is contained in:
萝卜
2026-03-16 03:59:46 +08:00
parent 3d74add7bc
commit b2b457907e
2 changed files with 157 additions and 90 deletions

View File

@@ -0,0 +1,45 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminProductImportHistoriesIndexShouldUseFiltersAndListCardStructureTest 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_product_import_histories_index_should_use_filters_and_list_card_structure(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin/products/import-histories');
$res->assertOk();
// 护栏:导入历史页应使用统一 Filters Card + List Card 结构。
$res->assertSee('filters-card', false);
$res->assertSee('filters-summary', false);
$res->assertSee('filters-body', false);
$res->assertSee('filters-grid', false);
$res->assertSee('list-card', false);
$res->assertSee('list-card-header', false);
$res->assertSee('list-card-body', false);
$res->assertSee('list-card-table', false);
// 分页统一:用扫描型护栏断言。
$blade = file_get_contents(resource_path('views/admin/products/import_histories.blade.php'));
$this->assertIsString($blade);
$this->assertStringContainsString("links('pagination.admin')", $blade);
}
}