PlatformOrder create: disable renewal type when no subscription context

This commit is contained in:
萝卜
2026-03-15 02:11:17 +00:00
parent fdd14c463c
commit 95116e9b7c
2 changed files with 48 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderCreateOrderTypeRenewalOptionDisabledWhenNoSubscriptionTest 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_create_form_should_disable_renewal_order_type_when_site_subscription_id_missing(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin/platform-orders/create');
$res->assertOk();
$res->assertSee('value="renewal" disabled', false);
$res->assertSee('续费单必须绑定订阅', false);
}
}