test(billing): guardrails for platform order create form fields
This commit is contained in:
@@ -47,6 +47,35 @@ class AdminPlatformOrderCreateTest extends TestCase
|
||||
$res->assertSee('创建订单');
|
||||
}
|
||||
|
||||
public function test_platform_order_create_form_should_render_core_fields(): void
|
||||
{
|
||||
$this->loginAsPlatformAdmin();
|
||||
|
||||
// 需要至少一个套餐供选择
|
||||
Plan::query()->create([
|
||||
'code' => 'create_order_plan_fields_01',
|
||||
'name' => '创建订单字段渲染测试套餐',
|
||||
'billing_cycle' => 'monthly',
|
||||
'price' => 100,
|
||||
'list_price' => 100,
|
||||
'status' => 'active',
|
||||
'sort' => 10,
|
||||
'published_at' => now(),
|
||||
]);
|
||||
|
||||
$res = $this->get('/admin/platform-orders/create');
|
||||
|
||||
$res->assertOk();
|
||||
|
||||
// Guardrails: 页面必须渲染出核心表单字段,否则运营无法下单。
|
||||
$res->assertSee('form-grid', false);
|
||||
$res->assertSee('name="merchant_id"', false);
|
||||
$res->assertSee('name="plan_id"', false);
|
||||
$res->assertSee('name="order_type"', false);
|
||||
$res->assertSee('name="quantity"', false);
|
||||
$res->assertSee('创建订单');
|
||||
}
|
||||
|
||||
public function test_platform_admin_can_open_create_platform_order_form_with_site_subscription_hint(): void
|
||||
{
|
||||
$this->loginAsPlatformAdmin();
|
||||
|
||||
Reference in New Issue
Block a user