补齐平台批次详情页边界护栏测试
This commit is contained in:
@@ -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('参数不完整:请提供 type(bas/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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user