36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
<?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);
|
||
}
|
||
}
|