login()->loginNami()->withoutExceptionHandling(); $form = Form::factory()->fields([ $this->textField('vorname')->name('Vorname')->required(true), ]) ->create(); $this->postJson(route('form.participant.store', ['form' => $form->id]), ['vorname' => 'Jane']) ->assertOk(); $this->assertEquals('Jane', $form->participants->first()->data['vorname']); ExportSyncAction::assertPushed(); } public function testItHasValidation(): void { Queue::fake(); $this->login()->loginNami(); $form = Form::factory()->fields([ $this->textField('vorname')->name('Vorname')->required(true), ]) ->create(); $this->postJson(route('form.participant.store', ['form' => $form->id]), ['vorname' => '']) ->assertJsonValidationErrors(['vorname' => 'Vorname ist erforderlich.']); } }