Files
saasshop/tests/Feature/AdminPlatformBatchShowPageShouldRenderErrorWhenParamsMissingTest.php
2026-03-20 08:39:08 +08:00

36 lines
1.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?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);
}
}