test select action inside modal
In my LeadResource, on the ListRecord page, I have a "Create" action that opens a form modal to create a new lead.
The form includes a select field with an action to create a new customer on the fly. When the user creates a customer, the customer ID should be associated with the new lead. I'm trying to write a test to verify:
- 1/ The new customer is created successfully.
- 2/ The ID of the newly created customer matches the one associated with the newly created lead.
Here’s what I have so far for testing the lead creation:
Now, I want to test the nested action for creating a customer. I’ve attempted this:
`
However, I’m struggling with the following:
- 1/ How to properly test the createCustomer action within the context of the "Create" action?
- 2/ How to assert that the new customer's ID is correctly associated with the newly created lead?
Any suggestions or examples for testing nested actions in Livewire?
Thanks in advance for your help!
1 Reply
Any suggestion ?