平台订单快捷筛选待支付/待生效补齐 data-role 与口径护栏

This commit is contained in:
萝卜
2026-03-18 16:07:02 +08:00
parent d136f8abe4
commit 01e9173ae4
2 changed files with 42 additions and 2 deletions

View File

@@ -0,0 +1,40 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderIndexQuickFiltersUnpaidAndPendingEffectiveShouldHaveDataRoleTest 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_unpaid_and_pending_effective_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-unpaid"', $html);
$this->assertStringContainsString('data-role="po-quickfilter-pending-effective"', $html);
// 钉死语义口径
$this->assertStringContainsString('payment_status=unpaid', $html);
$this->assertStringContainsString('payment_status=paid', $html);
$this->assertStringContainsString('status=pending', $html);
$this->assertStringContainsString('sync_status=unsynced', $html);
}
}