diff --git a/resources/views/admin/platform_leads/index.blade.php b/resources/views/admin/platform_leads/index.blade.php index 3877120..898528f 100644 --- a/resources/views/admin/platform_leads/index.blade.php +++ b/resources/views/admin/platform_leads/index.blade.php @@ -116,7 +116,7 @@ {{ $l->source }} {{ optional($l->created_at)->format('Y-m-d H:i:s') }} - 创建订单 + 创建订单 @empty diff --git a/tests/Feature/AdminPlatformLeadIndexCreateOrderLinkUsesButtonStyleTest.php b/tests/Feature/AdminPlatformLeadIndexCreateOrderLinkUsesButtonStyleTest.php new file mode 100644 index 0000000..bff86be --- /dev/null +++ b/tests/Feature/AdminPlatformLeadIndexCreateOrderLinkUsesButtonStyleTest.php @@ -0,0 +1,56 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_index_should_render_create_order_link_as_btn_component(): void + { + $this->loginAsPlatformAdmin(); + + $plan = Plan::query()->create([ + 'code' => 'lead_btn_plan', + 'name' => '线索按钮样式测试套餐', + 'billing_cycle' => 'monthly', + 'price' => 10, + 'list_price' => 10, + 'status' => 'active', + 'sort' => 10, + 'published_at' => now(), + ]); + + PlatformLead::query()->create([ + 'name' => '按钮样式线索', + 'mobile' => '13800000002', + 'email' => 'btn@example.com', + 'company' => '样式公司', + 'source' => 'test', + 'status' => 'new', + 'plan_id' => $plan->id, + 'meta' => ['from' => 'test'], + ]); + + $res = $this->get('/admin/platform-leads'); + $res->assertOk(); + + $res->assertSee('class="btn btn-sm"', false); + $res->assertSee('>创建订单<', false); + } +}