feat: custom class in entry form

and update Dusk test for featured image selection
This commit is contained in:
jon brookes 2026-01-05 17:17:48 +00:00
parent bef3ae7f41
commit ae662a30ef
2 changed files with 8 additions and 2 deletions

View file

@ -43,8 +43,9 @@ class EntryForm
->dehydrated(false) ->dehydrated(false)
->hintAction( ->hintAction(
Action::make('featured_picker') Action::make('featured_picker')
->label('Pick from Gallery') ->label('Featured Image from Gallery')
->icon('heroicon-m-photo') ->icon('heroicon-m-photo')
->extraAttributes(['id' => 'featured-picker-button'])
->schema([ ->schema([
Select::make('image_id') Select::make('image_id')
->label('Select an existing image') ->label('Select an existing image')

View file

@ -7,7 +7,7 @@ use Laravel\Dusk\Browser;
use Tests\Browser\Concerns\AuthenticatesUsers; use Tests\Browser\Concerns\AuthenticatesUsers;
use Tests\DuskTestCase; use Tests\DuskTestCase;
class UploadImageAdminTest extends DuskTestCase class CreateEntryAdminTest extends DuskTestCase
{ {
use DatabaseTruncation; use DatabaseTruncation;
use AuthenticatesUsers; use AuthenticatesUsers;
@ -53,6 +53,11 @@ class UploadImageAdminTest extends DuskTestCase
->waitForText('Updated at') ->waitForText('Updated at')
->assertSee('Updated at') ->assertSee('Updated at')
->visit('/admin/entries/1/edit') ->visit('/admin/entries/1/edit')
->waitForText('Edit TEST ENTRY')
->pause(2000)
->waitForText('Featured Image')
->click('#featured-picker-button')
->pause(10000), ->pause(10000),
1000 // Custom pause time for this test 1000 // Custom pause time for this test
); );