Test Form Component Action
I have a Custom Page which includes a header Action. The Action is a slide over, which shows a form to create a model. I want to test if the action executes as expected an create the record, as well as if the fields that are conditionally disabled are really disabled when they should be. My test looks like this :
and passes when executed.
2 Replies
The Form looks like this:
I have got a second test to assert the validation errors which passes too:
Now when i add the ->assertFormFieldExists('mountedActionsData.0.name') function the test fails with this error message: "Failed asserting that a field with the name [data.mountedActionsData.0.name] exists on the form with the name [form] on the [App\Filament\Customer\Resources\LocationResource\Pages\ListLocationTariffs] component."
I don't know if my test overall is correct and how i can test the form fields. Would be really nice if someone could help me with this.
i think its like this