平台订单快捷筛选补齐核心治理入口 data-role 与口径护栏

This commit is contained in:
萝卜
2026-03-18 16:00:43 +08:00
parent 351a60859e
commit 13d87748c6
2 changed files with 43 additions and 3 deletions

View File

@@ -0,0 +1,40 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderIndexQuickFiltersCoreGovernanceShouldHaveDataRoleTest 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_platform_orders_index_quick_filters_core_governance_should_have_data_role(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin/platform-orders');
$res->assertOk();
$html = (string) $res->getContent();
$this->assertStringContainsString('data-role="po-quickfilter-bmpa-processable"', $html);
$this->assertStringContainsString('data-role="po-quickfilter-syncable"', $html);
$this->assertStringContainsString('data-role="po-quickfilter-sync-failed"', $html);
// 也钉一下关键 query 语义,避免链接口径被误改
$this->assertStringContainsString('bmpa_processable_only=1', $html);
$this->assertStringContainsString('syncable_only=1', $html);
$this->assertStringContainsString('sync_status=failed', $html);
}
}