Platform orders index: add batch review link in run_id badges

This commit is contained in:
萝卜
2026-03-18 08:30:57 +08:00
parent 940f329684
commit b9f49d21ee
2 changed files with 61 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderIndexBatchRunIdBadgesShouldIncludeReviewLinksTest 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_platform_orders_page_batch_run_id_badges_should_include_review_links(): void
{
$this->loginAsPlatformAdmin();
$basRunId = 'BAS_BADGE_REVIEW_LINK_0001';
$bmpaRunId = 'BMPA_BADGE_REVIEW_LINK_0001';
$htmlBas = $this->get('/admin/platform-orders?batch_activation_run_id=' . $basRunId)
->assertOk()
->getContent();
$this->assertStringContainsString('查看批次复盘', $htmlBas);
$this->assertStringContainsString('/admin/platform-batches/show?type=bas', $htmlBas);
$this->assertStringContainsString('run_id=' . $basRunId, $htmlBas);
$this->assertStringContainsString('back=', $htmlBas);
$htmlBmpa = $this->get('/admin/platform-orders?batch_bmpa_run_id=' . $bmpaRunId)
->assertOk()
->getContent();
$this->assertStringContainsString('查看批次复盘', $htmlBmpa);
$this->assertStringContainsString('/admin/platform-batches/show?type=bmpa', $htmlBmpa);
$this->assertStringContainsString('run_id=' . $bmpaRunId, $htmlBmpa);
$this->assertStringContainsString('back=', $htmlBmpa);
}
}