From 1b05d4f1f5343a0293fa5b3087b4dbbad57a2459 Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Tue, 26 May 2026 19:47:38 +0300 Subject: [PATCH] test missing element --- backend/tests/Feature/ElementsEndpointTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/tests/Feature/ElementsEndpointTest.php b/backend/tests/Feature/ElementsEndpointTest.php index 1683cf0..be69aec 100644 --- a/backend/tests/Feature/ElementsEndpointTest.php +++ b/backend/tests/Feature/ElementsEndpointTest.php @@ -38,4 +38,14 @@ class ElementsEndpointTest extends TestCase ], ]); } + + public function testReturns404WhenElementDoesNotExist(): void + { + $response = $this->getJson('/api/elements/999'); + + $response->assertNotFound(); + $response->assertExactJson([ + 'error' => 'Element not found', + ]); + } }