Commit 449a84fe authored by Phil Hughes's avatar Phil Hughes

fixed up specs caused by left over elements in the body

parent 80c788bb
...@@ -122,7 +122,8 @@ export const mouseEnterTopItems = (el) => { ...@@ -122,7 +122,8 @@ export const mouseEnterTopItems = (el) => {
export const mouseLeaveTopItem = (el) => { export const mouseLeaveTopItem = (el) => {
const subItems = el.querySelector('.sidebar-sub-level-items'); 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); el.classList.remove(IS_OVER_CLASS);
}; };
......
...@@ -13,7 +13,7 @@ import { ...@@ -13,7 +13,7 @@ import {
} from '~/fly_out_nav'; } from '~/fly_out_nav';
import bp from '~/breakpoints'; import bp from '~/breakpoints';
fdescribe('Fly out sidebar navigation', () => { describe('Fly out sidebar navigation', () => {
let el; let el;
let breakpointSize = 'lg'; let breakpointSize = 'lg';
...@@ -28,7 +28,7 @@ fdescribe('Fly out sidebar navigation', () => { ...@@ -28,7 +28,7 @@ fdescribe('Fly out sidebar navigation', () => {
}); });
afterEach(() => { afterEach(() => {
el.remove(); document.body.innerHTML = '';
breakpointSize = 'lg'; breakpointSize = 'lg';
mousePos.length = 0; mousePos.length = 0;
}); });
...@@ -59,7 +59,7 @@ fdescribe('Fly out sidebar navigation', () => { ...@@ -59,7 +59,7 @@ fdescribe('Fly out sidebar navigation', () => {
describe('getHideSubItemsInterval', () => { describe('getHideSubItemsInterval', () => {
beforeEach(() => { 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', () => { it('returns 0 if currentOpenMenu is nil', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment