Allow longer blog post excerpts
This commit is contained in:
37
tests/Unit/BlogPostExcerptFieldTest.php
Normal file
37
tests/Unit/BlogPostExcerptFieldTest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use App\Filament\Blog\Resources\PostResource;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Schemas\Concerns\InteractsWithSchemas;
|
||||
use Filament\Schemas\Contracts\HasSchemas;
|
||||
use Filament\Schemas\Schema;
|
||||
use Livewire\Component;
|
||||
use Tests\TestCase;
|
||||
|
||||
class BlogPostExcerptFieldTest extends TestCase
|
||||
{
|
||||
public function test_excerpt_fields_allow_long_text(): void
|
||||
{
|
||||
$livewire = new class extends Component implements HasSchemas
|
||||
{
|
||||
use InteractsWithSchemas;
|
||||
|
||||
public function render(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
};
|
||||
|
||||
$schema = PostResource::form(Schema::make($livewire));
|
||||
|
||||
$excerptDe = $schema->getComponentByStatePath('excerpt.de');
|
||||
$excerptEn = $schema->getComponentByStatePath('excerpt.en');
|
||||
|
||||
$this->assertInstanceOf(Textarea::class, $excerptDe);
|
||||
$this->assertInstanceOf(Textarea::class, $excerptEn);
|
||||
$this->assertSame(65535, $excerptDe->getMaxLength());
|
||||
$this->assertSame(65535, $excerptEn->getMaxLength());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user