feat(platform-orders): add copy run_id buttons in bas/bmpa run badges

This commit is contained in:
萝卜
2026-03-18 04:19:27 +08:00
parent f27e395a51
commit 59910e05aa
2 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderIndexBatchRunIdBadgesShouldRenderCopyButtonsTest 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_batch_run_id_badges_should_render_copy_buttons(): void
{
$this->loginAsPlatformAdmin();
$html = $this->get('/admin/platform-orders?batch_activation_run_id=BAS_COPY_0001&batch_bmpa_run_id=BMPA_COPY_0001')
->assertOk()
->getContent();
// BAS 徽章区 copy
$this->assertStringContainsString('data-copy-label="BAS run_id"', $html);
$this->assertStringContainsString('data-copy-text="BAS_COPY_0001"', $html);
// BMPA 徽章区 copy
$this->assertStringContainsString('data-copy-label="BMPA run_id"', $html);
$this->assertStringContainsString('data-copy-text="BMPA_COPY_0001"', $html);
}
}