Trying to test action on specific tab
I have multiple Tab in my ViewRecord page and i want to test if an action is exists on this specific tab. How can i set the active tab using the livewire() function?
5 Replies
Are these tabs relation managers or schemas?
They are in the schema
Following this testing docs section, I came to this:
1. Add a
key()
to the tab that you want to test in order to make it accesible by the test itself:
2. Now, you can point to that specific tab and check with checkComponentUsing
if there is the action that you expect:
Also, inside the
checkComponentUsing
you can do a lot of validations against your action. For example, you can test if is the expected action has a specific label, url, etc. Just an example:
When trying your solution, i couldn't check that a tab exists directly. I needed to do it in the checkComponentUsing like this :
Thank you nonetheless for the tip.