feat(batch): 批次页增加一键复制run_id(轻量JS)

This commit is contained in:
萝卜
2026-03-17 16:21:58 +08:00
parent 8f409e2124
commit 38ac28ada2
3 changed files with 103 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformBatchShowPageCopyRunIdButtonShouldRenderTest 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_batch_show_page_should_render_copy_run_id_button(): void
{
$this->loginAsPlatformAdmin();
$runId = 'BAS_COPY_BTN_0001';
$html = $this->get('/admin/platform-batches/show?type=bas&run_id=' . $runId)
->assertOk()
->getContent();
$this->assertStringContainsString('data-action="copy-run-id"', $html);
$this->assertStringContainsString('data-run-id="' . $runId . '"', $html);
$this->assertStringContainsString('复制 run_id', $html);
}
}