werpu / jsfs_js_ts

Apache License 2.0
2 stars 1 forks source link

add test for FormData #7

Closed henningn closed 4 years ago

henningn commented 4 years ago

Currently myfaces-tobago 5.0.0 is in development. Tobago 5 use the current Typescript implementation of "jsf.js". Now, I've encountered a different behavior between the old jsf.js and the new Typescript implementation.

With the old jsf.js the FormData could have multiple values for a key. I believe this is correct, because of the FormData.getAll method. See: https://developer.mozilla.org/en-US/docs/Web/API/FormData/getAll

The Typescript implementation overwrite a value of a key, so only the last value is stored.

I've added a test that fails, because it checks the old behavior. I would also like to have a fix included, but I was not able to solve this with only small changes. XhrFormData extends Config which stores no more than one value per key.

werpu commented 4 years ago

Hi Henning, I will take over this bug and fix it, and yes this is a sidebehavior, I was not really aware of, and it needs to be fixed correctly. Thanks for the test I will take over the bug in the upcoming days (I am on vacation next week, but i probably will find some time to squash the fix in)

werpu commented 4 years ago

merged in working on the fix, will be online later today

werpu commented 4 years ago

Yes the bug is exposed, I will investigate why only the last checkbox value is submitted and you are right both should be.

werpu commented 4 years ago

fixed the issue, a new build is online. This was a major update of the form handling in the underlying monadish libs. All tests pass, but please give it a proper test. I hope I did not break anything.