diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-25 15:12:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-25 15:12:20 +0300 |
commit | 73507eaf1a77c5c05ae17c9f7ac29bbeb8bf5be1 (patch) | |
tree | 7f9b8b4246b9d0ce354866b07f4e9f657ac9665d /spec/support/helpers | |
parent | 86ace8a66caeb11a2912e15e8a9abc3d9e4960c2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/helpers')
-rw-r--r-- | spec/support/helpers/javascript_form_helper.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/support/helpers/javascript_form_helper.rb b/spec/support/helpers/javascript_form_helper.rb new file mode 100644 index 00000000000..41c5ba4373b --- /dev/null +++ b/spec/support/helpers/javascript_form_helper.rb @@ -0,0 +1,7 @@ +# 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 |