summaryrefslogtreecommitdiff
path: root/spec/javascripts/fly_out_nav_spec.js
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-09-16 17:19:59 +0000
committerAnnabel Dunstone Gray <annabel.dunstone@gmail.com>2017-09-16 17:19:59 +0000
commit9ddc62ccfc16f3d6cc5f6c6a8624c5f7b5067faf (patch)
treecb0e99f808370b7b264dd4b35941efeb87e487ef /spec/javascripts/fly_out_nav_spec.js
parenta70c76df8fd746e5a83b305acbbc1c260955e332 (diff)
downloadgitlab-ce-9ddc62ccfc16f3d6cc5f6c6a8624c5f7b5067faf.tar.gz
Fixed the new sidebars width when browser has scrollbars
Diffstat (limited to 'spec/javascripts/fly_out_nav_spec.js')
-rw-r--r--spec/javascripts/fly_out_nav_spec.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/javascripts/fly_out_nav_spec.js b/spec/javascripts/fly_out_nav_spec.js
index f8b37c0edde..f4b4d7980a4 100644
--- a/spec/javascripts/fly_out_nav_spec.js
+++ b/spec/javascripts/fly_out_nav_spec.js
@@ -271,12 +271,19 @@ describe('Fly out sidebar navigation', () => {
});
it('sets transform of sub-items', () => {
+ const sidebar = document.createElement('div');
const subItems = el.querySelector('.sidebar-sub-level-items');
+
+ sidebar.style.width = '200px';
+
+ document.body.appendChild(sidebar);
+
+ setSidebar(sidebar);
showSubLevelItems(el);
expect(
subItems.style.transform,
- ).toBe(`translate3d(0px, ${Math.floor(el.getBoundingClientRect().top) - getHeaderHeight()}px, 0px)`);
+ ).toBe(`translate3d(200px, ${Math.floor(el.getBoundingClientRect().top) - getHeaderHeight()}px, 0px)`);
});
it('sets is-above when element is above', () => {