From 3e563f8390ff48effec7b48689f305c5d4da9b6e Mon Sep 17 00:00:00 2001 From: philipp lang Date: Thu, 12 Dec 2024 15:21:03 +0100 Subject: [PATCH] Add registration_from and registration_to fields --- resources/js/views/form/Index.vue | 2 ++ tests/Feature/Form/FormUpdateActionTest.php | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/resources/js/views/form/Index.vue b/resources/js/views/form/Index.vue index 4a4d7913..8975d903 100644 --- a/resources/js/views/form/Index.vue +++ b/resources/js/views/form/Index.vue @@ -56,6 +56,8 @@ > + + assertTrue($form->config->sections->get(0)->fields->get(0)->maxToday); } + public function testItSetsRegistrationDates(): void + { + $this->login()->loginNami()->withoutExceptionHandling(); + $form = Form::factory()->create(); + $payload = FormRequest::new()->registrationFrom('2023-05-04 01:00:00')->registrationUntil('2023-07-07 01:00:00')->create(); + + $this->patchJson(route('form.update', ['form' => $form]), $payload)->assertOk(); + + $form = $form->fresh(); + + $this->assertEquals('2023-05-04 01:00', $form->registration_from->format('Y-m-d H:i')); + $this->assertEquals('2023-07-07 01:00', $form->registration_until->format('Y-m-d H:i')); + } + public function testItSetsTexts(): void { $this->login()->loginNami()->withoutExceptionHandling();