Commit Graph

9 Commits

Author SHA1 Message Date
Jean-Baptiste Bellet
251ab2ac9a Payment method id attribute don't need to start with paymentmethod 2023-01-23 17:46:26 +01:00
Jean-Baptiste Bellet
2d86e8857a Put payment method description just above the
+ update spec by adding `data-paymentmethod-id` attribute
2022-12-28 15:21:29 +01:00
Cillian O'Ruanaidh
1b8c1bd27a Only initialise Stimulus app once in Jest tests in :beforeAll rather than :beforeEach
Before there was an issue with the remote_toggle_controller tests, which contains two tests. If you commented out one test and ran the other it would pass and vice versa but if both tests were uncommented only the first test would ever pass, the second one would fail. See https://github.com/openfoodfoundation/openfoodnetwork/pull/8805#discussion_r801464322

Co-authored-by: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com>
2022-02-11 10:21:26 +00:00
Matt-Yorkley
b4dab46cf8 Remove unused code for changing required attributes 2021-12-20 18:36:28 +00:00
Jean-Baptiste Bellet
7b6aa99de2 Handle when input is already checked
ie. user hasn't click on anything
2021-12-20 15:34:58 +01:00
Jean-Baptiste Bellet
fd5ad7566a Disabled all form elements that should not be sent to the controller 2021-12-07 16:27:22 +00:00
Jean-Baptiste Bellet
5f3ea6accb Do not init by hidden all the container
that allow to init the content without clicking on anything
2021-12-07 16:27:22 +00:00
Jean-Baptiste Bellet
7159cc3ff1 Handle required attribute on input for PaymentMethod controller
This is done for one reason : do not submit form with required attribute on input that are actually hidden ; this is not handle correctly by browsers.

This idea here is to add/remove the required attribute on each input if the form is visible or not.
2021-12-07 16:27:22 +00:00
Jean-Baptiste Bellet
3063b041d1 Change the paymentmethod controller to handle both desc and form
Add tests as well

Update _payment.html.haml

Update _payment.html.haml
2021-12-07 16:23:39 +00:00