test(governance-ui): disable batch mark activated when sync_status=synced

This commit is contained in:
萝卜
2026-03-17 05:38:42 +08:00
parent 2f8bc32ba1
commit f0340af59f

View File

@@ -0,0 +1,38 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderIndexBatchMarkActivatedButtonShouldDisableWhenSyncStatusSyncedTest 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_mark_activated_button_should_disable_when_sync_status_synced_even_if_paid_pending(): void
{
$this->loginAsPlatformAdmin();
// paid + pending 但 sync_status=synced与“待生效 unsynced”口径互斥
$res = $this->get('/admin/platform-orders?payment_status=paid&status=pending&sync_status=synced');
$res->assertOk();
$html = (string) $res->getContent();
$this->assertStringContainsString('批量仅标记为已生效(当前筛选范围)', $html);
$this->assertStringContainsString('data-role="batch-mark-activated-blocked-hint"', $html);
$this->assertStringContainsString('sync_status=unsynced', $html);
$this->assertTrue(str_contains($html, 'type="submit" disabled') || str_contains($html, 'disabled="disabled"'));
}
}