<?php

namespace Tests\Feature;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

class AdminPlatformOrderQuickFilterShouldShowLeadLockHintTest 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_quick_filter_block_should_show_lead_lock_hint_when_lead_id_present(): void
    {
        $this->loginAsPlatformAdmin();

        $res = $this->get('/admin/platform-orders?lead_id=12');
        $res->assertOk();

        $res->assertSee('当前锁定线索：#12', false);
        $res->assertSee('>清除<', false);
    }
}
