Placeholder Component Testing

Hello is it possible to test the Placeholder ?
Forms\Components\Placeholder::make('first_name')
->label(trans('First Name'))
->content(fn (Order $record): string => $record->customer_first_name)


it('can render view order page', function () {
$order = OrderFactory::new()->createOne();

livewire(ViewOrder::class, ['record' => $order->getRouteKey()])
->assertFormExists()
->assertSuccessful()
->assertFormSet([
'first_name' => $order->customer_first_name,
])
->assertOk();
});
Forms\Components\Placeholder::make('first_name')
->label(trans('First Name'))
->content(fn (Order $record): string => $record->customer_first_name)


it('can render view order page', function () {
$order = OrderFactory::new()->createOne();

livewire(ViewOrder::class, ['record' => $order->getRouteKey()])
->assertFormExists()
->assertSuccessful()
->assertFormSet([
'first_name' => $order->customer_first_name,
])
->assertOk();
});
1 Reply
Patrick Boivin
Patrick Boivin16mo ago
The placeholder is not really a form field... Have you tried testing it with ->assertSee() instead?
Want results from more Discord servers?
Add your server