mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-03 22:06:07 +00:00
Rename JS file so that it is loaded after the spree code it is overriding. Admin can't add products outside distribution to an order.
This commit is contained in:
@@ -129,6 +129,15 @@ module WebHelper
|
||||
targetted_select2(value, options)
|
||||
end
|
||||
|
||||
def have_select2_option(value, options)
|
||||
container = options[:dropdown_css] || ".select2-with-searchbox"
|
||||
page.execute_script %Q{$('#{options[:from]}').select2('open')}
|
||||
page.execute_script "$('#{container} input.select2-input').val('#{value}').trigger('keyup-change');"
|
||||
sleep 1
|
||||
have_selector "div.select2-result-label", text: value
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
def wait_for_ajax
|
||||
wait_until { page.evaluate_script("$.active") == 0 }
|
||||
|
||||
Reference in New Issue
Block a user