33 lines
819 B
PHP
33 lines
819 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace Tests\Feature\Api\V1\IncoSheets;
|
||
|
|
|
||
|
|
use Infra\Database\Models\IncoSheet;
|
||
|
|
|
||
|
|
describe('IncoSheets 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([
|
||
|
|
'id' => '12345',
|
||
|
|
'name' => 'Poulet Rôti 1kg Test',
|
||
|
|
]);
|
||
|
|
|
||
|
|
// WHEN
|
||
|
|
$response = $test->getJson("/api/v1/inco-sheets/{$sheet->id}");
|
||
|
|
|
||
|
|
// THEN
|
||
|
|
$response->assertStatus(200);
|
||
|
|
$response->assertJson([
|
||
|
|
'incoSheet' => [
|
||
|
|
'id' => '12345',
|
||
|
|
'name' => 'Poulet Rôti 1kg Test',
|
||
|
|
],
|
||
|
|
]);
|
||
|
|
});
|
||
|
|
});
|