补齐平台批次详情页边界护栏测试

This commit is contained in:
萝卜
2026-03-20 08:39:08 +08:00
parent d85a3d383a
commit 26d284d3e4
4 changed files with 356 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformBatchShowPageShouldRenderErrorWhenParamsMissingTest 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_error_when_type_or_run_id_missing(): void
{
$this->loginAsPlatformAdmin();
$html = $this->get('/admin/platform-batches/show?type=bas')
->assertOk()
->getContent();
$this->assertStringContainsString('参数不完整:请提供 typebas/bmpa与 run_id。', $html);
$this->assertStringContainsString('href="/admin/platform-orders"', $html);
$this->assertStringNotContainsString('data-action="copy-run-id"', $html);
$this->assertStringNotContainsString('data-role="batch-spot-check-link"', $html);
}
}