debian-mirror-gitlab/spec/support/helpers/javascript_form_helper.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

8 lines
228 B
Ruby
Raw Normal View History

2022-10-11 01:57:18 +05:30
# 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