From 659f9b88f190affe8dbe220ce58ac422e7b4053a Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Fri, 1 May 2026 10:24:43 +0300 Subject: [PATCH] test scheduled node controller surfaces date error from use case --- .../Controllers/ScheduledNodeControllerTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/e2e/Controllers/ScheduledNodeControllerTest.php b/tests/e2e/Controllers/ScheduledNodeControllerTest.php index 0ff0766..085a6d8 100644 --- a/tests/e2e/Controllers/ScheduledNodeControllerTest.php +++ b/tests/e2e/Controllers/ScheduledNodeControllerTest.php @@ -155,6 +155,21 @@ class ScheduledNodeControllerTest extends TestCase $this->assertEquals(400, $response->getStatusCode()); $body = json_decode((string) $response->getBody(), true); $this->assertArrayHasKey('error', $body); + $this->assertEquals('date is required', $body['error']); + } + + public function test_returns_400_when_date_query_param_empty_string(): void + { + $response = $this->controller->getScheduledNodes( + $this->makeRequest('', $this->user), + new Response(), + $this->getTodaysSchedule, + ); + + $this->assertEquals(400, $response->getStatusCode()); + $body = json_decode((string) $response->getBody(), true); + $this->assertArrayHasKey('error', $body); + $this->assertEquals('date is required', $body['error']); } public function test_excludes_future_scheduled_nodes(): void