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

This commit is contained in:
萝卜
2026-03-17 13:37:15 +08:00
parent 96c1a1562d
commit 9e40e73481
2 changed files with 68 additions and 1 deletions

View File

@@ -0,0 +1,41 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderIndexBatchActivationRunIdBadgeQuickLinksShouldRenderTest 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_run_id_badge_quick_links(): void
{
$this->loginAsPlatformAdmin();
$runId = 'BAS_TEST_BADGE_0001';
$html = $this->get('/admin/platform-orders?batch_activation_run_id=' . $runId)
->assertOk()
->getContent();
$this->assertStringContainsString('当前 run_id<strong>' . $runId . '</strong>', $html);
// 本批次失败
$this->assertStringContainsString('batch_activation_run_id=' . $runId, $html);
$this->assertStringContainsString('sync_status=failed', $html);
// 本批次可同步重试unsynced + syncable_only=1
$this->assertStringContainsString('syncable_only=1', $html);
$this->assertStringContainsString('sync_status=unsynced', $html);
}
}