How to test Header/Footer Actions in a Section Form Component
callFormComponentAction fails with error "Call to a member function getKey() on null" when attempting to test calling a section header action.
Can callFormComponentAction() be used to test Header/Footer actions on Form Sections.
Test Code:
Form Code:
1 Reply
I was able to solve this with a change to the key string used with the Section form component.
In my case i was rendering the form from a custom page with a "data" statePath. When using the livewire test helper function "callFormComponentAction" , the code is looking for the component using the statePath and the key name.
Custom page form function
I was able to call the Header Action in a Section by prefixing the key with the state path in the schema but using the non-state path key in the test.
Test Code