Hi.
There's something with unit testing flash data that I'm not understanding.
Livewire component has this code; session()->flash('errorMessage', 'blah blah')
Unit test has this code;
$response = Livewire::test(Login::class)
->set('email', '[email protected]')
->set('password', 'wrongPassword')
->call('submit')
// ->assertSessionHas('_flash.new.0');
->assertSessionHasInput('errorMessage', 'blah blah');
The assertSessionHas() call works, but only when i drill down through the array (like in the commented example above).
assertSessionHasInput('errorMessage) or assertSessionHas('errorMessage') does not work.
The result of $response->dumpSession(); is;
array:1 [
"_flash" => array:2 [
"new" => array:1 [
0 => "errorMessage"
]
"old" => []
]
]
I'm referencing the docs here; https://laravel.com/docs/8.x/http-tests#assert-session-has-input
Please help me understand why checking for the errorMessage key is failing.