mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Check "Select all" to start with
Reflect the state of the shipping method checkboxes.
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
%tr{ "data-controller": "select-all" }
|
||||
%td.text-center
|
||||
%label
|
||||
= check_box_tag "bla", nil, shipping_methods == @order_cycle.shipping_methods, { "data-action": "change->select-all#toggleAll", "data-select-all-target": "all" }
|
||||
= check_box_tag "bla", nil, (shipping_methods - @order_cycle.shipping_methods).empty?, { "data-action": "change->select-all#toggleAll", "data-select-all-target": "all" }
|
||||
= "Select all"
|
||||
%td
|
||||
- if shipping_methods.any?
|
||||
|
||||
@@ -158,11 +158,15 @@ describe '
|
||||
end
|
||||
|
||||
def select_shipping_methods
|
||||
expect(page).to have_checked_field "Select all"
|
||||
|
||||
expect(page).to have_checked_field "Pickup - always available"
|
||||
expect(page).to have_checked_field "Delivery - sometimes available"
|
||||
|
||||
uncheck "Delivery - sometimes available"
|
||||
|
||||
expect(page).to have_unchecked_field "Select all"
|
||||
|
||||
click_button 'Save and Back to List'
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user