debian-mirror-gitlab/spec/support/helpers/javascript_form_helper.rb
2022-10-11 01:57:18 +05:30

7 lines
228 B
Ruby

# frozen_string_literal: true
module JavascriptFormHelper
def prevent_submit_for(query_selector)
execute_script("document.querySelector('#{query_selector}').addEventListener('submit', e => e.preventDefault())")
end
end