Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e1ba7861
Commit
e1ba7861
authored
Aug 30, 2021
by
Vitaly Slobodin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce constant for the old sidebar width
parent
15e1a3a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
spec/frontend_integration/fly_out_nav_browser_spec.js
spec/frontend_integration/fly_out_nav_browser_spec.js
+8
-5
No files found.
spec/frontend_integration/fly_out_nav_browser_spec.js
View file @
e1ba7861
...
...
@@ -21,6 +21,7 @@ describe('Fly out sidebar navigation', () => {
let
el
;
let
breakpointSize
=
'
lg
'
;
const
OLD_SIDEBAR_WIDTH
=
200
;
const
CONTAINER_INITIAL_BOUNDING_RECT
=
{
x
:
8
,
y
:
8
,
...
...
@@ -51,7 +52,8 @@ describe('Fly out sidebar navigation', () => {
mockBoundingClientRect
(
el
,
CONTAINER_INITIAL_BOUNDING_RECT
);
mockBoundingClientRect
(
subItems
,
SUB_ITEMS_INITIAL_BOUNDING_RECT
);
};
const
mockSidebarFragment
=
(
styleProps
=
''
)
=>
`<div class="sidebar-sub-level-items" style="
${
styleProps
}
"></div>`
const
mockSidebarFragment
=
(
styleProps
=
''
)
=>
`<div class="sidebar-sub-level-items" style="
${
styleProps
}
"></div>`
;
beforeEach
(()
=>
{
el
=
document
.
createElement
(
'
div
'
);
...
...
@@ -82,7 +84,6 @@ describe('Fly out sidebar navigation', () => {
describe
(
'
getHideSubItemsInterval
'
,
()
=>
{
beforeEach
(()
=>
{
el
.
innerHTML
=
mockSidebarFragment
(
'
position: fixed; top: 0; left: 100px; height: 150px;
'
);
mockBoundingRects
();
});
...
...
@@ -177,7 +178,9 @@ describe('Fly out sidebar navigation', () => {
describe
(
'
mouseEnterTopItems
'
,
()
=>
{
beforeEach
(()
=>
{
el
.
innerHTML
=
mockSidebarFragment
(
'
position: absolute; top: 0; left: 100px; height: 200px;
'
);
el
.
innerHTML
=
mockSidebarFragment
(
`position: absolute; top: 0; left: 100px; height:
${
OLD_SIDEBAR_WIDTH
}
px;`
,
);
mockBoundingRects
();
});
...
...
@@ -271,7 +274,7 @@ describe('Fly out sidebar navigation', () => {
const
sidebar
=
document
.
createElement
(
'
div
'
);
const
subItems
=
findSubItems
();
sidebar
.
style
.
width
=
'
200px
'
;
sidebar
.
style
.
width
=
`
${
OLD_SIDEBAR_WIDTH
}
px`
;
document
.
body
.
appendChild
(
sidebar
);
...
...
@@ -279,7 +282,7 @@ describe('Fly out sidebar navigation', () => {
showSubLevelItems
(
el
);
expect
(
subItems
.
style
.
transform
).
toBe
(
`translate3d(
200
px,
${
`translate3d(
${
OLD_SIDEBAR_WIDTH
}
px,
${
Math
.
floor
(
el
.
getBoundingClientRect
().
top
)
-
getHeaderHeight
()
}
px, 0)`
,
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment