chore(ui): 线索列表创建订单入口改用统一按钮样式
This commit is contained in:
@@ -116,7 +116,7 @@
|
||||
<td>{{ $l->source }}</td>
|
||||
<td>{{ optional($l->created_at)->format('Y-m-d H:i:s') }}</td>
|
||||
<td>
|
||||
<a class="muted" href="{!! $buildCreatePlatformOrderUrl($l) !!}">创建订单</a>
|
||||
<a class="btn btn-sm" href="{!! $buildCreatePlatformOrderUrl($l) !!}">创建订单</a>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Models\Plan;
|
||||
use App\Models\PlatformLead;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminPlatformLeadIndexCreateOrderLinkUsesButtonStyleTest 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_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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user