diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-02-02 11:09:24 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-02-02 11:09:24 +0000 |
commit | 21ea4863ea42a83566193862579329d865176ff9 (patch) | |
tree | 07c74e727eeb868a8de2cf9aa4c871b6c1d5b4b5 | |
parent | 7460702088f2265c1229cb8ec7d6fdcdda99bf9d (diff) | |
download | gitlab-ce-21ea4863ea42a83566193862579329d865176ff9.tar.gz |
Fixes broken build: Use jquery to get the element position in the pagefix-broken-buil-9724713
-rw-r--r-- | spec/features/merge_requests/toggler_behavior_spec.rb | 5 |
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 |