test scheduled node controller surfaces date error from use case

This commit is contained in:
Yisroel Baum 2026-05-01 10:24:43 +03:00
parent 2eafe67f31
commit 659f9b88f1
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

@ -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