Add registration_from and registration_to fields

This commit is contained in:
philipp lang 2024-12-12 15:21:03 +01:00
parent 0a5590d533
commit 3e563f8390
2 changed files with 16 additions and 2 deletions

View File

@ -56,6 +56,8 @@
></f-singlefile>
<f-text id="from" v-model="single.from" type="date" label="Von" required></f-text>
<f-text id="to" v-model="single.to" type="date" label="Bis" required></f-text>
<f-text id="registration_from" v-model="single.registration_from" type="datetime-local" label="Registrierung von" required></f-text>
<f-text id="registration_until" v-model="single.registration_until" type="datetime-local" label="Registrierung bis" required></f-text>
<f-textarea
id="excerpt"
v-model="single.excerpt"

View File

@ -5,8 +5,6 @@ namespace Tests\Feature\Form;
use App\Fileshare\Data\FileshareResourceData;
use App\Form\Data\ExportData;
use App\Form\Models\Form;
use App\Lib\Editor\Condition;
use App\Lib\Editor\EditorData;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\RequestFactories\EditorRequestFactory;
@ -31,6 +29,20 @@ class FormUpdateActionTest extends FormTestCase
$this->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();