Governance: block clear sync errors when synced_only present

This commit is contained in:
萝卜
2026-03-17 00:13:19 +08:00
parent c0e3dffce1
commit 0e8a9797b9
4 changed files with 101 additions and 0 deletions

View File

@@ -58,6 +58,22 @@ class AdminPlatformOrderIndexClearErrorButtonsShouldDisableWhenNotInFailedScopeT
$this->assertTrue(str_contains($html, 'type="submit" disabled') || str_contains($html, 'disabled="disabled"'));
}
public function test_clear_sync_errors_button_should_disable_when_synced_only_checked_even_if_in_failed_scope(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin/platform-orders?sync_status=failed&synced_only=1');
$res->assertOk();
$html = (string) $res->getContent();
$this->assertStringContainsString('清除同步失败标记(当前筛选范围)', $html);
$this->assertStringContainsString('data-role="clear-sync-errors-blocked-hint"', $html);
$this->assertStringContainsString('只看已同步', $html);
$this->assertTrue(str_contains($html, 'type="submit" disabled') || str_contains($html, 'disabled="disabled"'));
}
public function test_clear_bmpa_errors_button_should_disable_when_syncable_only_checked_even_if_in_bmpa_failed_scope(): void
{
$this->loginAsPlatformAdmin();