ui(platform-orders): add bmpa run_id badge with quick links

This commit is contained in:
萝卜
2026-03-17 14:20:43 +08:00
parent a806ed9b1c
commit eef0fbad8a
2 changed files with 72 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderIndexBatchBmpaRunIdBadgeShouldRenderTest 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_page_should_render_batch_bmpa_run_id_badge_and_quick_links(): void
{
$this->loginAsPlatformAdmin();
$runId = 'BMPA_TEST_BADGE_0001';
$html = $this->get('/admin/platform-orders?batch_bmpa_run_id=' . $runId)
->assertOk()
->getContent();
$this->assertStringContainsString('当前 BMPA run_id<strong>' . $runId . '</strong>', $html);
// 快捷入口:本批次失败(应带 batch_bmpa_run_id + bmpa_failed_only=1
$this->assertStringContainsString('batch_bmpa_run_id=' . $runId, $html);
$this->assertStringContainsString('bmpa_failed_only=1', $html);
}
}