feat(import): сервис StatusRuToSlugMapper (ТЗ §6.4)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Services\Import\StatusRuToSlugMapper;
|
||||
|
||||
test('маппит все 14 канонических статусов §6.4', function (): void {
|
||||
$mapper = new StatusRuToSlugMapper;
|
||||
|
||||
expect($mapper->toSlug('Новые'))->toBe('new')
|
||||
->and($mapper->toSlug('Оплачено'))->toBe('paid')
|
||||
->and($mapper->toSlug('Конечный недозвон'))->toBe('final_missed')
|
||||
->and($mapper->map())->toHaveCount(14);
|
||||
});
|
||||
|
||||
test('тримит пробелы вокруг значения', function (): void {
|
||||
expect((new StatusRuToSlugMapper)->toSlug(' Переговоры '))->toBe('negotiations');
|
||||
});
|
||||
|
||||
test('возвращает null для неизвестного статуса', function (): void {
|
||||
expect((new StatusRuToSlugMapper)->toSlug('Архив'))->toBeNull()
|
||||
->and((new StatusRuToSlugMapper)->toSlug(''))->toBeNull();
|
||||
});
|
||||
Reference in New Issue
Block a user