From f4e3c2e6bfc70248874f1c2f343be0bb328be39d Mon Sep 17 00:00:00 2001 From: Boban Blaskovic Date: Fri, 22 May 2026 06:20:26 +0200 Subject: [PATCH] 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 --- .../UUID/NoNumericIdInResponseTest.php | 25 +++++++++++++++++++ tests/Feature/Wire/WireModalDeleteTest.php | 7 ++++++ 2 files changed, 32 insertions(+) create mode 100644 tests/Feature/UUID/NoNumericIdInResponseTest.php create mode 100644 tests/Feature/Wire/WireModalDeleteTest.php diff --git a/tests/Feature/UUID/NoNumericIdInResponseTest.php b/tests/Feature/UUID/NoNumericIdInResponseTest.php new file mode 100644 index 0000000..bd28774 --- /dev/null +++ b/tests/Feature/UUID/NoNumericIdInResponseTest.php @@ -0,0 +1,25 @@ +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'); +}); diff --git a/tests/Feature/Wire/WireModalDeleteTest.php b/tests/Feature/Wire/WireModalDeleteTest.php new file mode 100644 index 0000000..e63555c --- /dev/null +++ b/tests/Feature/Wire/WireModalDeleteTest.php @@ -0,0 +1,7 @@ +markTestSkipped('No DeleteComponent implemented yet — pattern documented here'); +});