From edffe0ef80dd8fbb595ae3c4f033a7e08cff7ff6 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Wed, 17 Apr 2024 10:19:56 +0200 Subject: [PATCH] Fixed tests --- tests/Feature/Form/FormRegisterActionTest.php | 12 +++++++++--- tests/Feature/Form/FormtemplateFieldRequest.php | 1 + tests/Feature/Form/FormtemplateIndexActionTest.php | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/Feature/Form/FormRegisterActionTest.php b/tests/Feature/Form/FormRegisterActionTest.php index 94429b03..6d16edd3 100644 --- a/tests/Feature/Form/FormRegisterActionTest.php +++ b/tests/Feature/Form/FormRegisterActionTest.php @@ -147,19 +147,25 @@ class FormRegisterActionTest extends FormTestCase ]; yield [ - $this->radioField('letter')->name('Buchstabe')->options(['A', 'B'])->required(false), + $this->radioField('letter')->name('Buchstabe')->options(['A', 'B'])->required(false)->allowcustom(false), ['letter' => 'Z'], ['letter' => 'Der gewählte Wert für Buchstabe ist ungültig.'] ]; yield [ - $this->radioField('letter')->name('Buchstabe')->options(['A', 'B'])->required(true), + $this->radioField('letter')->name('Buchstabe')->options(['A', 'B'])->required(true)->allowcustom(false), ['letter' => 'Z'], ['letter' => 'Der gewählte Wert für Buchstabe ist ungültig.'] ]; yield [ - $this->radioField('letter')->name('Buchstabe')->options(['A', 'B'])->required(true), + $this->radioField('letter')->name('Buchstabe')->options(['A', 'B'])->required(true)->allowcustom(true), + ['letter' => 'lalalaa'], + null, + ]; + + yield [ + $this->radioField('letter')->name('Buchstabe')->options(['A', 'B'])->required(true)->allowcustom(false), ['letter' => 'A'], null ]; diff --git a/tests/Feature/Form/FormtemplateFieldRequest.php b/tests/Feature/Form/FormtemplateFieldRequest.php index 51683832..c950a633 100644 --- a/tests/Feature/Form/FormtemplateFieldRequest.php +++ b/tests/Feature/Form/FormtemplateFieldRequest.php @@ -24,6 +24,7 @@ use App\Form\Enums\SpecialType; * @method self hint(string $hint) * @method self min(int $min) * @method self max(int $max) + * @method self allowcustom(bool $allowcustom) */ class FormtemplateFieldRequest extends RequestFactory { diff --git a/tests/Feature/Form/FormtemplateIndexActionTest.php b/tests/Feature/Form/FormtemplateIndexActionTest.php index dd5ced8b..a165dac0 100644 --- a/tests/Feature/Form/FormtemplateIndexActionTest.php +++ b/tests/Feature/Form/FormtemplateIndexActionTest.php @@ -44,6 +44,7 @@ class FormtemplateIndexActionTest extends TestCase 'hint' => '', 'options' => [], 'required' => true, + 'allowcustom' => false, ] ]) ->assertInertiaPath('data.meta.fields.9', [