Files
portal/app/tests/Unit/Autopodbor/Study/CompetitorFingerprintTest.php
T

22 lines
942 B
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
use App\Services\Autopodbor\Agent\Study\CompetitorFingerprint;
it('строит отпечаток из конкурента + региона (схему добавляет)', function () {
$fp = (new CompetitorFingerprint)->build(
['name' => 'КрасЛомбард', 'site_url' => 'kraslombard24.ru', 'is_federal' => false],
29,
);
expect($fp->name)->toBe('КрасЛомбард')
->and($fp->seedDomain)->toBe('kraslombard24.ru')
->and($fp->city)->toBe('Красноярск')
->and($fp->areaCode)->toBe('391')
->and($fp->gisSlug)->toBe('krasnoyarsk')
->and($fp->isFederal)->toBeFalse();
});
it('site_url с path+utm → seed только хост', function () {
$fp = (new CompetitorFingerprint)->build(['name' => 'X', 'site_url' => 'http://авто-займ-124.рф/kras?utm=1'], 29);
expect($fp->seedDomain)->toBe('авто-займ-124.рф');
});