Livewire works but test says: not !
Hi, I'm testing a livewire component , the test is error session should be thrown when from inputs are empty :
/**
* @test
*/
public function while_creating_a_post_the_empty_inputs_should_return_errors()
{
Livewire::test('posts')
->set('title' , '')
->set('text' , '')
->call('store')
->assertSessionHasErrors(['title'=>'required','text'=>'required']);
}
the error messages works in action but the test says: no error session has been set ..
Try with the assertHasErrors method instead
public function while_creating_a_post_the_empty_inputs_should_return_errors()
{
Livewire::test('posts')
->set('title' , '')
->set('text' , '')
->call('store')
->assertHasErrors(['title'=>'required','text'=>'required']);
}
@tykus it worked !!! thanks๐๐๐
Please or to participate in this conversation.