feat(batch): 批次页治理入口增加复制链接按钮
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminPlatformBatchShowPageCopyGovernanceLinksButtonsShouldRenderTest 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_buttons_for_governance_links_when_present(): void
|
||||
{
|
||||
$this->loginAsPlatformAdmin();
|
||||
|
||||
// 不依赖 DB:该页面即使 summary 缺失也会渲染治理入口(本批次失败/按Top原因)是否存在取决于 controller summary。
|
||||
// 这里用 BAS + 任意 run_id,只校验按钮结构存在;治理链接内容在其它测试已覆盖。
|
||||
$runId = 'BAS_COPY_LINKS_0001';
|
||||
|
||||
// 该 run_id 在空库下 summary 为空,controller 仍会生成 failed/all/retry 链接,因此“本批次失败”应存在。
|
||||
$html = $this->get('/admin/platform-batches/show?type=bas&run_id=' . $runId)
|
||||
->assertOk()
|
||||
->getContent();
|
||||
|
||||
$this->assertStringContainsString('data-action="copy-link"', $html);
|
||||
$this->assertStringContainsString('data-role="copy-failed-link"', $html);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user