ldc-arcadia-api/tests/Feature/Api/V1/IncoSheets/IncoSheetShowTest.php
Jérémy Munsch 152ee2b5a2
feat(api): add IncoSheets feature with DDD clean architecture, tests & OpenAPI spec
- Use cases: FindAllIncoSheets & FindIncoSheet (filters, pagination, short projection)
- Presentation: controllers, FormRequests with scalar validation, DTOs (camelCase)
- Ports & Adapters: IncoSheetDirectory & EloquentIncoSheetDirectory
- Tests: Pest 4 unit, integration, OpenAPI spectator conformance, dynamic arch tests
- Docs: updated Bruno collection and OpenAPI spec
2026-08-14 11:33:05 +02:00

31 lines
790 B
PHP

<?php
declare(strict_types=1);
namespace Tests\Feature\Api\V1\IncoSheets;
use Infra\Database\Models\IncoSheet;
describe('IncoSheet Show Feature API', function (): void {
it('returns 200 OK with inco sheet details for valid inco sheet ID', function (): void {
// GIVEN
/** @var \Tests\TestCase $test */
$test = $this;
$sheet = IncoSheet::factory()->create([
'name' => 'Poulet Rôti 1kg Test',
]);
// WHEN
$response = $test->getJson("/api/v1/inco-sheets/{$sheet->id}");
// THEN
$response->assertStatus(200);
$response->assertJson([
'incoSheet' => [
'id' => $sheet->id,
'name' => 'Poulet Rôti 1kg Test',
],
]);
});
});