Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Feb 24, 2024
1 parent bba3bcd commit 30b7ed8
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/Fields/DropdownTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace Cone\Root\Tests\Fields;

use Cone\Root\Fields\Dropdown;
use Cone\Root\Tests\TestCase;

class DropdownTest extends TestCase
{
protected Dropdown $field;

public function setUp(): void
{
parent::setUp();

$this->field = Dropdown::make('Sizes')
->options([
's' => 'S',
'm' => 'M',
'l' => 'L',
]);
}

public function test_a_fieldset_field_has_fieldset_template(): void
{
$this->assertSame('root::fields.dropdown', $this->field->getTemplate());
}
}
29 changes: 29 additions & 0 deletions tests/Fields/FieldsetTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Cone\Root\Tests\Fields;

use Cone\Root\Fields\Fieldset;
use Cone\Root\Fields\Text;
use Cone\Root\Tests\TestCase;

class FieldsetTest extends TestCase
{
protected Fieldset $field;

public function setUp(): void
{
parent::setUp();

$this->field = Fieldset::make('Properties')
->withFields(function () {
return [
new Text('Name'),
];
});
}

public function test_a_fieldset_field_has_fieldset_template(): void
{
$this->assertSame('root::fields.fieldset', $this->field->getTemplate());
}
}

0 comments on commit 30b7ed8

Please sign in to comment.