feat(api): UUID-only response test + WireModal pattern doc

Phase 11: NoNumericIdInResponseTest verifies /api/v1/me returns no numeric 'id' key and includes 'uuid'. WireModalDeleteTest documents the Livewire openModal pattern (skipped pending MVP-2 component).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
Boban Blaskovic 2026-05-22 06:20:26 +02:00
parent ae19135e09
commit f4e3c2e6bf
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,25 @@
<?php
use App\Models\User;
use function Pest\Laravel\actingAs;
uses(\Illuminate\Foundation\Testing\RefreshDatabase::class);
it('gibt keine numerischen IDs in API-Responses zurück', function () {
$user = User::factory()->create();
$response = actingAs($user)->getJson('/api/v1/me')->assertOk();
$json = $response->json();
$collectKeys = function (array $arr) use (&$collectKeys): array {
$keys = array_keys($arr);
foreach ($arr as $v) {
if (is_array($v)) {
$keys = array_merge($keys, $collectKeys($v));
}
}
return $keys;
};
expect($collectKeys($json))->not->toContain('id');
expect($json)->toHaveKey('uuid');
});

View File

@ -0,0 +1,7 @@
<?php
// Documents the pattern: delete confirmations use Livewire events, not window.confirm
it('delete-Aktion dispatcht openModal statt window.confirm', function () {
// Marked pending until a real delete component is implemented in MVP-2+
$this->markTestSkipped('No DeleteComponent implemented yet — pattern documented here');
});