summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2017-02-02 13:36:32 +0000
committerFatih Acet <acetfatih@gmail.com>2017-02-02 13:36:32 +0000
commit4d3011f3109670261117d89b379a13a0f878812d (patch)
treec21201ad182619fcd5fa3907315089164bfd28fa
parentef0f1336d8585243775410c91fe2327428713706 (diff)
parent21ea4863ea42a83566193862579329d865176ff9 (diff)
downloadgitlab-ce-4d3011f3109670261117d89b379a13a0f878812d.tar.gz
Merge branch 'fix-broken-buil-9724713' into 'master'
Fixes broken build: Use jquery to get the element position in the page See merge request !8926
-rw-r--r--spec/features/merge_requests/toggler_behavior_spec.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/spec/features/merge_requests/toggler_behavior_spec.rb b/spec/features/merge_requests/toggler_behavior_spec.rb
index 6958f6a2c9f..44a9b545ff8 100644
--- a/spec/features/merge_requests/toggler_behavior_spec.rb
+++ b/spec/features/merge_requests/toggler_behavior_spec.rb
@@ -18,11 +18,10 @@ feature 'toggler_behavior', js: true, feature: true do
it 'should be scrolled down to fragment' do
page_height = page.current_window.size[1]
page_scroll_y = page.evaluate_script("window.scrollY")
- fragment_position_top = page.evaluate_script("document.querySelector('#{fragment_id}').getBoundingClientRect().top")
-
+ fragment_position_top = page.evaluate_script("$('#{fragment_id}').offset().top")
expect(find('.js-toggle-content').visible?).to eq true
expect(find(fragment_id).visible?).to eq true
- expect(fragment_position_top).to be > page_scroll_y
+ expect(fragment_position_top).to be >= page_scroll_y
expect(fragment_position_top).to be < (page_scroll_y + page_height)
end
end