d6cddf73a6
Этап 1 Task 8. По 2 карточки на каждую из 8 стадий у указанного менеджера (для показа досок). Baseline под artisan() Pest-паттерн. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
22 lines
804 B
PHP
22 lines
804 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Models\SalesProspect;
|
|
use App\Models\SalesUser;
|
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
|
|
uses(DatabaseTransactions::class);
|
|
|
|
test('sales:prospects-demo наполняет карточки для менеджера по всем стадиям', function () {
|
|
$mgr = SalesUser::create([
|
|
'name' => 'Демо '.uniqid(), 'email' => 'demo'.uniqid().'@s.local',
|
|
'password' => bcrypt('x'), 'role' => 'manager', 'is_active' => true,
|
|
]);
|
|
|
|
$this->artisan('sales:prospects-demo', ['salesUserId' => $mgr->id])->assertExitCode(0);
|
|
|
|
$stages = SalesProspect::where('sales_user_id', $mgr->id)->pluck('stage')->unique();
|
|
expect($stages)->toContain('new')->toContain('negotiation')->toContain('testing')->toContain('user');
|
|
});
|