diff --git a/app/Form/Resources/FormtemplateResource.php b/app/Form/Resources/FormtemplateResource.php index 2252fc6c..ef81161d 100644 --- a/app/Form/Resources/FormtemplateResource.php +++ b/app/Form/Resources/FormtemplateResource.php @@ -31,6 +31,13 @@ class FormtemplateResource extends JsonResource [ 'id' => 'TextField', 'name' => 'Text', + 'default' => [ + 'name' => '', + 'type' => 'TextField', + 'columns' => ['mobile' => 2, 'tablet' => 4, 'desktop' => 12], + 'default' => '', + 'required' => false, + ] ] ], 'links' => [ @@ -43,6 +50,8 @@ class FormtemplateResource extends JsonResource ] ], 'section_default' => [ + 'name' => '', + 'intro' => '', 'fields' => [], ] ]; diff --git a/tests/Feature/Form/FormtemplateIndexActionTest.php b/tests/Feature/Form/FormtemplateIndexActionTest.php index 01be7d10..57859c6a 100644 --- a/tests/Feature/Form/FormtemplateIndexActionTest.php +++ b/tests/Feature/Form/FormtemplateIndexActionTest.php @@ -18,6 +18,13 @@ class FormtemplateIndexActionTest extends TestCase ->assertInertiaPath('data.meta.fields.0', [ 'id' => 'TextField', 'name' => 'Text', + 'default' => [ + 'name' => '', + 'type' => 'TextField', + 'columns' => ['mobile' => 2, 'tablet' => 4, 'desktop' => 12], + 'default' => '', + 'required' => false, + ] ]) ->assertInertiaPath('data.meta.default', [ 'name' => '', @@ -27,6 +34,8 @@ class FormtemplateIndexActionTest extends TestCase ]) ->assertInertiaPath('data.meta.links.store', route('formtemplate.store')) ->assertInertiaPath('data.meta.section_default', [ + 'name' => '', + 'intro' => '', 'fields' => [], ]); }