diff options
author | Phil Hughes <me@iamphill.com> | 2017-08-10 09:10:25 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-08-15 09:28:00 +0100 |
commit | b5a773923e49d40fd06806541b89ecb947b45884 (patch) | |
tree | 039874b4201e148787158d0aa063305cfb2a6691 /spec | |
parent | de0d0e4e47dffdab3f507ba93dcdff27da4d7421 (diff) | |
download | gitlab-ce-b5a773923e49d40fd06806541b89ecb947b45884.tar.gz |
Fix the fly-out menu in the sidebar not displaying in Safarisafari-fly-out-fix
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/fly_out_nav_spec.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/javascripts/fly_out_nav_spec.js b/spec/javascripts/fly_out_nav_spec.js index 65a7459c5ed..2e81a1b056b 100644 --- a/spec/javascripts/fly_out_nav_spec.js +++ b/spec/javascripts/fly_out_nav_spec.js @@ -10,6 +10,7 @@ import { mousePos, getHideSubItemsInterval, documentMouseMove, + getHeaderHeight, } from '~/fly_out_nav'; import bp from '~/breakpoints'; @@ -59,7 +60,7 @@ describe('Fly out sidebar navigation', () => { describe('getHideSubItemsInterval', () => { beforeEach(() => { - el.innerHTML = '<div class="sidebar-sub-level-items" style="position: fixed; top: 0; left: 100px; height: 50px;"></div>'; + el.innerHTML = '<div class="sidebar-sub-level-items" style="position: fixed; top: 0; left: 100px; height: 150px;"></div>'; }); it('returns 0 if currentOpenMenu is nil', () => { @@ -112,6 +113,7 @@ describe('Fly out sidebar navigation', () => { clientX: el.getBoundingClientRect().left + 20, clientY: el.getBoundingClientRect().top + 10, }); + console.log(el); expect( getHideSubItemsInterval(), @@ -245,7 +247,7 @@ describe('Fly out sidebar navigation', () => { expect( subItems.style.transform, - ).toBe(`translate3d(0px, ${Math.floor(el.getBoundingClientRect().top)}px, 0px)`); + ).toBe(`translate3d(0px, ${Math.floor(el.getBoundingClientRect().top) - getHeaderHeight()}px, 0px)`); }); it('sets is-above when element is above', () => { |