summaryrefslogtreecommitdiff
path: root/spec/support/helpers/drag_to_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/helpers/drag_to_helper.rb')
-rw-r--r--spec/support/helpers/drag_to_helper.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/support/helpers/drag_to_helper.rb b/spec/support/helpers/drag_to_helper.rb
index 2e9932f2e8a..692a4d2b30e 100644
--- a/spec/support/helpers/drag_to_helper.rb
+++ b/spec/support/helpers/drag_to_helper.rb
@@ -1,7 +1,8 @@
# frozen_string_literal: true
module DragTo
- def drag_to(list_from_index: 0, from_index: 0, to_index: 0, list_to_index: 0, selector: '', scrollable: 'body', duration: 1000, perform_drop: true)
+ # rubocop:disable Metrics/ParameterLists
+ def drag_to(list_from_index: 0, from_index: 0, to_index: 0, list_to_index: 0, selector: '', scrollable: 'body', duration: 1000, perform_drop: true, extra_height: 0)
js = <<~JS
simulateDrag({
scrollable: document.querySelector('#{scrollable}'),
@@ -14,7 +15,8 @@ module DragTo
el: document.querySelectorAll('#{selector}')[#{list_to_index}],
index: #{to_index}
},
- performDrop: #{perform_drop}
+ performDrop: #{perform_drop},
+ extraHeight: #{extra_height}
});
JS
evaluate_script(js)
@@ -23,6 +25,7 @@ module DragTo
loop while drag_active?
end
end
+ # rubocop:enable Metrics/ParameterLists
def drag_active?
page.evaluate_script('window.SIMULATE_DRAG_ACTIVE').nonzero?