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
parent
ae19135e09
commit
f4e3c2e6bf
|
|
@ -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');
|
||||||
|
});
|
||||||
|
|
@ -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');
|
||||||
|
});
|
||||||
Loading…
Reference in New Issue