Files
portal/app/tests/Feature/LeadStatusesFunnelTest.php
T

26 lines
1.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
declare(strict_types=1);
use Illuminate\Support\Facades\DB;
test('lead_statuses содержит ровно 5 статусов воронки', function () {
$slugs = DB::table('lead_statuses')->orderBy('sort_order')->pluck('slug')->all();
expect($slugs)->toBe(['new', 'viewed', 'in_progress', 'won', 'lost']);
});
test('новые статусы имеют корректные русские названия', function () {
$names = DB::table('lead_statuses')->pluck('name_ru', 'slug');
expect($names['new'])->toBe('Новая сделка');
expect($names['in_progress'])->toBe('В работе');
expect($names['won'])->toBe('Сделка');
expect($names['lost'])->toBe('Не реализовано');
});
test('старых slug-ов воронки в lead_statuses не осталось', function () {
$obsolete = DB::table('lead_statuses')
->whereIn('slug', ['worked', 'paid', 'closed', 'hot', 'negotiations'])
->count();
expect($obsolete)->toBe(0);
});