Add non nami members
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
fa2d93174a
commit
3f3ecf0071
|
@ -54,7 +54,7 @@ class NamiField extends Field
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$this->key . '.*.id' => ['required', 'numeric', 'exists:members,mitgliedsnr'],
|
$this->key . '.*.id' => ['nullable', 'numeric', 'exists:members,mitgliedsnr'],
|
||||||
...$rules,
|
...$rules,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -556,6 +556,21 @@ class FormRegisterActionTest extends FormTestCase
|
||||||
$this->assertEquals('othervalue', $form->participants->get(1)->data['other']);
|
$this->assertEquals('othervalue', $form->participants->get(1)->data['other']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testItAddsMemberForNonNami(): void
|
||||||
|
{
|
||||||
|
$this->login()->loginNami();
|
||||||
|
$this->createMember(['mitgliedsnr' => '5505']);
|
||||||
|
$form = Form::factory()->fields([
|
||||||
|
$this->namiField('members'),
|
||||||
|
$this->textField('other')->required(false),
|
||||||
|
])
|
||||||
|
->create();
|
||||||
|
|
||||||
|
$this->register($form, ['other' => '::string::', 'members' => [['id' => null, 'other' => 'othervalue']]])
|
||||||
|
->assertOk();
|
||||||
|
$this->assertEquals('othervalue', $form->participants->get(1)->data['other']);
|
||||||
|
}
|
||||||
|
|
||||||
public function testItValidatesMembersFields(): void
|
public function testItValidatesMembersFields(): void
|
||||||
{
|
{
|
||||||
$this->login()->loginNami();
|
$this->login()->loginNami();
|
||||||
|
|
Loading…
Reference in New Issue