Is it possible to test forms in actions?
https://filamentphp.com/docs/3.x/actions/testing
Looking at the documentation I'm not sure I can do this, but is there an easy way to test forms inside of actions that I add to my livewire components?
For example, how could I mount an action in my livewire component and test a field is both visible and has a value?
If it would help I could post pseudo code as an example, but really just any pointers would be wildly useful. π
4 Replies
Ooo ChatGPT might have saved me on this one. It looks like I need to dig into the mountedActionData to test.
Does this look sane? Should I beable to just reply on assertSet and use those class variables to test instead of all the fancy helper functions available for forms, etc.?
I'm having trouble finding how to set and test field values, visibility etc. for forms inside of actions.
I can mountAction() successfully for example, but when I go to assert a field exists I get errors:
Is there a way to mount a form in an action and then do standard 'filament form' testing to that form?
i.e. things like assertFormFieldExists, etc.
Try ->assertActionFormFieldExists()
Not π― to be honest