test(IncoSheets): add test for PaginatedShortIncoSheet instantiation

Added a test to verify the correct instantiation of PaginatedShortIncoSheet
from the IncoShortSheet domain entity.
This commit is contained in:
Jérémy Munsch 2026-08-14 16:26:08 +02:00
parent 64f2f1c3ca
commit 2900c85b33
Signed by: forge-joniko
GPG key ID: D7EFE2F5CB6CC0E4

View file

@ -12,6 +12,7 @@ use Application\Usecase\IncoSheets\FindAll\PaginatedShortIncoSheet;
use Application\Usecase\IncoSheets\FindAll\SortColumn;
use Application\Usecase\IncoSheets\FindAll\Sorter;
use Domain\Models\Entities\Inco\IncoSheet;
use Domain\Models\Entities\Inco\IncoShortSheet;
use Domain\Models\ValueObjects\Inco\Allegations;
use Domain\Models\ValueObjects\Inco\Brand;
use Domain\Models\ValueObjects\Inco\IncoId;
@ -91,9 +92,17 @@ describe('FindAllIncoSheets DTOs Instantiation & Logic', function (): void {
updatedAt: null,
);
$shortSheet = new IncoShortSheet(
id: $incoId,
name: 'Poulet Rôti 1kg',
label: 'Poulet Rôti Classe A',
createdAt: null,
updatedAt: null,
);
// WHEN
$full = PaginatedIncoSheet::fromDomain($incoSheet);
$short = PaginatedShortIncoSheet::fromDomain($incoSheet);
$short = PaginatedShortIncoSheet::fromDomain($shortSheet);
$output = new Output([$full, $short], 1, 1, 10);
// THEN