feat(admin): 平台订单筛选增加线索ID(lead_id)与上下文提示

This commit is contained in:
萝卜
2026-03-14 04:12:22 +00:00
parent b6d6b06593
commit 7c0d70d49c
2 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderIndexLeadIdFilterFormFieldTest 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_lead_id_filter_field(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin/platform-orders');
$res->assertOk();
$res->assertSee('name="lead_id"', false);
$res->assertSee('线索ID', false);
}
public function test_index_should_render_lead_context_badge_when_filtered(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin/platform-orders?lead_id=12');
$res->assertOk();
$res->assertSee('当前线索:#12', false);
}
}