Test Livewire assertDispatched and assertSee after event dispatched
Hello,
I have the following field :
And I have the following test :
When I run my test, I have the following fails :
and
I have the following field :
And I have the following test :
When I run my test, I have the following fails :
and
- I don't understand why the first assertion fails and why the parameters aren't correct as I send the
$statewhen I dispatch the event. - I don't understand why
22,12is not in the HTML as when I test it in my browser, it works like a charm.
Solution
I answer to myself, I found a topic on Laracast for the second problem I have : https://laracasts.com/discuss/channels/livewire/livewire-testing-nested-components
For the first issue, I don't use the good syntax, which must be
For the first issue, I don't use the good syntax, which must be
->assertDispatched('updatedSelectedLicenses', selectedLicenses: [$license->id])Laracasts