2023-12-22 20:40:24 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Feature\Form;
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
|
|
use Tests\TestCase;
|
|
|
|
|
|
|
|
class FormtemplateIndexActionTest extends TestCase
|
|
|
|
{
|
|
|
|
|
|
|
|
use DatabaseTransactions;
|
|
|
|
|
|
|
|
public function testItDisplaysIndexPage(): void
|
|
|
|
{
|
|
|
|
$this->login()->loginNami()->withoutExceptionHandling();
|
|
|
|
|
|
|
|
$this->get(route('formtemplate.index'))
|
|
|
|
->assertInertiaPath('data.meta.fields.0', [
|
|
|
|
'id' => 'TextField',
|
|
|
|
'name' => 'Text',
|
2023-12-25 19:35:00 +01:00
|
|
|
'default' => [
|
|
|
|
'name' => '',
|
|
|
|
'type' => 'TextField',
|
|
|
|
'columns' => ['mobile' => 2, 'tablet' => 4, 'desktop' => 12],
|
|
|
|
'default' => '',
|
|
|
|
'required' => false,
|
|
|
|
]
|
2023-12-22 20:40:24 +01:00
|
|
|
])
|
|
|
|
->assertInertiaPath('data.meta.default', [
|
|
|
|
'name' => '',
|
|
|
|
'config' => [
|
|
|
|
'sections' => [],
|
|
|
|
]
|
|
|
|
])
|
|
|
|
->assertInertiaPath('data.meta.links.store', route('formtemplate.store'))
|
|
|
|
->assertInertiaPath('data.meta.section_default', [
|
2023-12-25 19:35:00 +01:00
|
|
|
'name' => '',
|
|
|
|
'intro' => '',
|
2023-12-22 20:40:24 +01:00
|
|
|
'fields' => [],
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|