login()->loginNami()->withoutExceptionHandling(); $participant = Participant::factory()->data(['vorname' => 'Max']) ->for(Form::factory()->fields([ $this->textField('vorname')->name('Vorname'), ])) ->create(); $this->patchJson(route('participant.update', ['participant' => $participant->id]), ['vorname' => 'Jane']) ->assertOk(); $this->assertEquals('Jane', $participant->fresh()->data['vorname']); ExportSyncAction::assertPushed(); } public function testItHasValidation(): void { $this->login()->loginNami(); $participant = Participant::factory()->data(['vorname' => 'Max', 'select' => ['A', 'B']]) ->for(Form::factory()->fields([ $this->textField('vorname')->name('Vorname')->required(true), ])) ->create(); $this->patchJson(route('participant.update', ['participant' => $participant->id]), ['vorname' => '']) ->assertJsonValidationErrors(['vorname' => 'Vorname ist erforderlich.']); } }