Governance UI: block batch mark activated in renewal missing subscription scope

This commit is contained in:
萝卜
2026-03-17 01:32:52 +08:00
parent 622c9be21e
commit 387b18d32b
2 changed files with 41 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderIndexBatchMarkActivatedButtonShouldDisableWhenRenewalMissingSubscriptionTest 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_renewal_missing_subscription_present(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin/platform-orders?renewal_missing_subscription=1');
$res->assertOk();
$html = (string) $res->getContent();
$this->assertStringContainsString('批量仅标记为已生效(当前筛选范围)', $html);
$this->assertStringContainsString('续费单未绑定订阅', $html);
$this->assertTrue(str_contains($html, 'type="submit" disabled') || str_contains($html, 'disabled="disabled"'));
}
}