I have a component UpdateProduct that takes a Product object in mount method.
class UpdateProduct extends Component
{
public $product;
public function mount(Product $product)
{
$this->product = $product;
}
}
How can I pass a product object while testing. I only found the below from the docs:
function can_create_post()
{
$this->actingAs(User::factory()->create());
Livewire::test(UpdateProduct::class) // Pass product object somewhere here.
->set('title', 'foo')
->call('create');
$this->assertTrue(Post::whereTitle('foo')->exists());
}