summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-08-10 13:24:03 +0100
committerPhil Hughes <me@iamphill.com>2017-08-14 08:59:13 +0100
commit449a84fe4063408b432d7bd59a399747a570fff1 (patch)
tree58c43399ebb3d90098741b310771cef484fdeb07
parent80c788bbeb875e724230a6ce64f09f98bbfe6f40 (diff)
downloadgitlab-ce-449a84fe4063408b432d7bd59a399747a570fff1.tar.gz
fixed up specs caused by left over elements in the body
-rw-r--r--app/assets/javascripts/fly_out_nav.js3
-rw-r--r--spec/javascripts/fly_out_nav_spec.js6
2 files changed, 5 insertions, 4 deletions
diff --git a/app/assets/javascripts/fly_out_nav.js b/app/assets/javascripts/fly_out_nav.js
index 9a2ab7f82b1..7d128cbf5fb 100644
--- a/app/assets/javascripts/fly_out_nav.js
+++ b/app/assets/javascripts/fly_out_nav.js
@@ -122,7 +122,8 @@ export const mouseEnterTopItems = (el) => {
export const mouseLeaveTopItem = (el) => {
const subItems = el.querySelector('.sidebar-sub-level-items');
- if (!canShowSubItems() || !canShowActiveSubItems(el) || (subItems && subItems === currentOpenMenu)) return;
+ if (!canShowSubItems() || !canShowActiveSubItems(el) ||
+ (subItems && subItems === currentOpenMenu)) return;
el.classList.remove(IS_OVER_CLASS);
};
diff --git a/spec/javascripts/fly_out_nav_spec.js b/spec/javascripts/fly_out_nav_spec.js
index dca58cb2eb2..65a7459c5ed 100644
--- a/spec/javascripts/fly_out_nav_spec.js
+++ b/spec/javascripts/fly_out_nav_spec.js
@@ -13,7 +13,7 @@ import {
} from '~/fly_out_nav';
import bp from '~/breakpoints';
-fdescribe('Fly out sidebar navigation', () => {
+describe('Fly out sidebar navigation', () => {
let el;
let breakpointSize = 'lg';
@@ -28,7 +28,7 @@ fdescribe('Fly out sidebar navigation', () => {
});
afterEach(() => {
- el.remove();
+ document.body.innerHTML = '';
breakpointSize = 'lg';
mousePos.length = 0;
});
@@ -59,7 +59,7 @@ fdescribe('Fly out sidebar navigation', () => {
describe('getHideSubItemsInterval', () => {
beforeEach(() => {
- el.innerHTML = '<div class="sidebar-sub-level-items" style="position: absolute; top: 0; left: 100px; height: 200px;"></div>';
+ el.innerHTML = '<div class="sidebar-sub-level-items" style="position: fixed; top: 0; left: 100px; height: 50px;"></div>';
});
it('returns 0 if currentOpenMenu is nil', () => {