alternative to fillForm or change/edit value of form

Hello, in test is there another way than fillForm to change a value via form? because I realize that it does not change value, attached dd($data) mutateFormDataBeforeSave and it is maintaining status 1 should be 2
9 Replies
toeknee
toeknee2y ago
You need to use closures, so for example if you change a value you would use say: ->reactive() ->afterStateUpdated(fn($state, Closure $get, $set) => $set('a diffferent field name', 'new value, of say $state');
José
JoséOP2y ago
sorry I think I was not clear enough, I mean in the tests if you see the capture you realized that I trying to test edit a resource ? @toeknee_iom
toeknee
toeknee2y ago
I'm not too sure, Dennis/Dan/Awo may have a better iidea
José
JoséOP2y ago
okthanks, can you tag them? please, because I don't know their usernames @toeknee_iom
toeknee
toeknee2y ago
@Dennis Koch or @Dan Harrin , I'm not sure on this one if you have an view
Dan Harrin
Dan Harrin2y ago
please open an issue with a minmal reproduction if its a real bug, you wont have a problem. if its a user error, you wont be able to reproduce it
Dennis Koch
Dennis Koch2y ago
You added to array items instead of key => value: fillForm(['buyer_status' => Order::PAGADO_COMPRADOR])
José
JoséOP2y ago
oh fuck damn 😅 you're right thanks!
Dan Harrin
Dan Harrin2y ago
good spot, i missed that too
Want results from more Discord servers?
Add your server