Admin subscriptions: hide batch expired action in attach order mode

This commit is contained in:
萝卜
2026-03-17 00:37:11 +08:00
parent f47cc71599
commit 7ce6a65aab
2 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminSiteSubscriptionIndexBatchMarkExpiredShouldHideWhenAttachOrderModeTest 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_expired_form_should_not_render_when_attach_order_mode_enabled(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin/site-subscriptions?attach_order_id=123&expiry=expired');
$res->assertOk();
$html = (string) $res->getContent();
// 在“绑定订阅到订单”模式下,工具区应专注绑定操作,避免出现批量治理动作造成误操作。
$this->assertStringNotContainsString('action="/admin/site-subscriptions/batch-mark-expired"', $html);
$this->assertStringNotContainsString('批量标记已过期(当前集合)', $html);
}
}