Closed rvmourik closed 1 year ago
Hi @rvmourik, you're right, I thought listeners and actions were identical but didn't see this nuance for events.
I'll work on a fix.
Hi @rvmourik, you're right, I thought listeners and actions were identical but didn't see this nuance for events.
I'll work on a fix.
Thanks for the quick reply, looking forward to it!
I am implementing the new test helpers in our project and so far all is working well but one thing. Maybe I am misinterpreting the way it should work but the docs state that you can test your component with calling an emit with one of the following two syntaxes:
I have a component with a
#[LiveListener]
listening to an event, like so:So in my assumption I can test the above by calling the following in my test:
However, this results in an error message stating the following: Expected method "CartUpdated" on class "App\Components\CartSummaryMobile"
Looking in the
TestLiveComponent
class in the UX package it uses the eventName as the method to call on the component it is testing. Otherwise, what would be the point of emitting an event? If it is using the method name I could have used the->call
method for executing a LiveAction I guess?In my assumption those two do not have to be the same right? If I am incorrect, then please let me know.
Thanks in advance.
Robbert