Files
saasshop/tests/Feature/AdminPlatformOrderIndexBatchActivationRunIdBadgeQuickLinksShouldRenderTest.php

44 lines
1.3 KiB
PHP
Raw Permalink 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 AdminPlatformOrderIndexBatchActivationRunIdBadgeQuickLinksShouldRenderTest 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_should_render_run_id_badge_quick_links(): void
{
$this->loginAsPlatformAdmin();
$runId = 'BAS_TEST_BADGE_0001';
$html = $this->get('/admin/platform-orders?batch_activation_run_id=' . $runId)
->assertOk()
->getContent();
$this->assertStringContainsString('当前 BAS run_id<strong>' . $runId . '</strong>', $html);
// 本批次全部
$this->assertStringContainsString('batch_activation_run_id=' . $runId, $html);
// 本批次失败
$this->assertStringContainsString('sync_status=failed', $html);
// 本批次可同步重试unsynced + syncable_only=1
$this->assertStringContainsString('syncable_only=1', $html);
$this->assertStringContainsString('sync_status=unsynced', $html);
}
}