Testing and requiresConfirmation
I have a RM with a table row action, that row action launches a modal with an approval action. I can get all the way up that point and it works fine in my test and will perform the approveAction, but if i add a confirmation to the approveAction, I cant seem to figure how to click the "Confirm" on the requiresConfirmation modal as it doesnt appear to have a mountAction for me to be able to call. This is wher i am so far:
15 Replies
I think the
approveAction
will be triggered when you invoke the callMountedTableAction
..@Leandro Ferreira it does and processes great if i do not have requiresConfirmation() on that action, but as soon as I add it back, it doesnt complete
hum..
Is the
approveAction
a extraModalFooterAction?No, they are completely overriden with modalFooterActions()
that seems to work, thanks! so why this way of doing it?
you have another action that should be fired. So you need to do
->call()->call()
...right, but where are you targeting the confirmation
if you inspect the code, we have two forms
1 - the approve action
2 - the confirmation
callMountedTableAction
will submit the actionwhy is the approve action not a table action if it is indeed a table action class?
sorry, just trying to wrap my head around it all so i can solve future issues. The inconsistency is what throws me a bit with some of this
btw, thanks for jumping in and helping me with test issues. i really appreciate it
You are right, sorry. We don't need to call
->callMountedAction()
callMountedTableAction will do thisso it looks like the issue was really more with me doing originally, which while was fine if i wanted to call just that action, but didnt allow the follow up ->callMountedTableAction() to handle the confirmation? Thus i had to do instead before it?
that looks to be the only difference
I tried mountTableAction, but it didn’t work as expected. I’m not entirely sure why it failed, but in situations where I encounter issues with helpers, I find that using Livewire helps me achieve my results.
If you encounter this issue, please feel free to submit a pull request ✌️
got it all working now with some comments and simplified a little