summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2017-08-16 09:10:36 +0000
committerTim Zallmann <tzallmann@gitlab.com>2017-08-16 09:10:36 +0000
commitaae23494393b1c2fc93bd9b39fc57aba7b792e63 (patch)
tree43a1b0e85f0c274c94f57b03b7b193eda3cb84ea /spec/javascripts
parentefa996d7281cfceb9ecfdbf43ef01dea903df038 (diff)
parentb5a773923e49d40fd06806541b89ecb947b45884 (diff)
downloadgitlab-ce-aae23494393b1c2fc93bd9b39fc57aba7b792e63.tar.gz
Merge branch 'safari-fly-out-fix' into 'master'
Fix the fly-out menu in the sidebar not displaying in Safari Closes #36441 See merge request !13445
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/fly_out_nav_spec.js6
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', () => {