Fixed tests
continuous-integration/drone/push Build is failing Details

This commit is contained in:
philipp lang 2024-04-17 10:19:56 +02:00
parent 58bb5ec87f
commit edffe0ef80
3 changed files with 11 additions and 3 deletions

View File

@ -147,19 +147,25 @@ class FormRegisterActionTest extends FormTestCase
]; ];
yield [ 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' => 'Z'],
['letter' => 'Der gewählte Wert für Buchstabe ist ungültig.'] ['letter' => 'Der gewählte Wert für Buchstabe ist ungültig.']
]; ];
yield [ 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' => 'Z'],
['letter' => 'Der gewählte Wert für Buchstabe ist ungültig.'] ['letter' => 'Der gewählte Wert für Buchstabe ist ungültig.']
]; ];
yield [ 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'], ['letter' => 'A'],
null null
]; ];

View File

@ -24,6 +24,7 @@ use App\Form\Enums\SpecialType;
* @method self hint(string $hint) * @method self hint(string $hint)
* @method self min(int $min) * @method self min(int $min)
* @method self max(int $max) * @method self max(int $max)
* @method self allowcustom(bool $allowcustom)
*/ */
class FormtemplateFieldRequest extends RequestFactory class FormtemplateFieldRequest extends RequestFactory
{ {

View File

@ -44,6 +44,7 @@ class FormtemplateIndexActionTest extends TestCase
'hint' => '', 'hint' => '',
'options' => [], 'options' => [],
'required' => true, 'required' => true,
'allowcustom' => false,
] ]
]) ])
->assertInertiaPath('data.meta.fields.9', [ ->assertInertiaPath('data.meta.fields.9', [