If you're testing a Livewire component and need to debug validation errors, the last response, the last rendered view, etc., Livewire offers these public properties on the tested component. I find dumping the lastErrorBag
handy pretty often!
/** @test */
public method something_works()
{
$component = Livewire::test(SomeComponent::class)->call('someMethod');
dd(
$component->lastValidator,
$component->lastErrorBag,
$component->lastResponse,
$component->lastRenderedView,
$component->lastRenderedDom,
);
}