- 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
31 lines
790 B
PHP
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',
|
|
],
|
|
]);
|
|
});
|
|
});
|