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
2f836faa
Commit
2f836faa
authored
Dec 23, 2019
by
Martin Wortschack
Committed by
Phil Hughes
Dec 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace breakpoints with GlBreakpointInstance in feature_highlight_options.js
parent
b159a2c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
app/assets/javascripts/feature_highlight/feature_highlight_options.js
...avascripts/feature_highlight/feature_highlight_options.js
+2
-2
spec/frontend/feature_highlight/feature_highlight_options_spec.js
...ntend/feature_highlight/feature_highlight_options_spec.js
+8
-2
No files found.
app/assets/javascripts/feature_highlight/feature_highlight_options.js
View file @
2f836faa
import
{
GlBreakpointInstance
as
bp
}
from
'
@gitlab/ui/dist/utils
'
;
import
{
highlightFeatures
}
from
'
./feature_highlight
'
;
import
bp
from
'
../breakpoints
'
;
export
default
function
domContentLoaded
()
{
if
(
bp
.
getBreakpointSize
()
===
'
lg
'
)
{
if
(
bp
.
getBreakpointSize
()
===
'
xl
'
)
{
highlightFeatures
();
return
true
;
}
...
...
spec/frontend/feature_highlight/feature_highlight_options_spec.js
View file @
2f836faa
import
{
GlBreakpointInstance
as
bp
}
from
'
@gitlab/ui/dist/utils
'
;
import
domContentLoaded
from
'
~/feature_highlight/feature_highlight_options
'
;
import
bp
from
'
~/breakpoints
'
;
describe
(
'
feature highlight options
'
,
()
=>
{
describe
(
'
domContentLoaded
'
,
()
=>
{
...
...
@@ -21,9 +21,15 @@ describe('feature highlight options', () => {
expect
(
domContentLoaded
()).
toBe
(
false
);
});
it
(
'
should
call highlightFeatures when breakpoint is lg
'
,
()
=>
{
it
(
'
should
not call highlightFeatures when breakpoint is not xl
'
,
()
=>
{
jest
.
spyOn
(
bp
,
'
getBreakpointSize
'
).
mockReturnValue
(
'
lg
'
);
expect
(
domContentLoaded
()).
toBe
(
false
);
});
it
(
'
should call highlightFeatures when breakpoint is xl
'
,
()
=>
{
jest
.
spyOn
(
bp
,
'
getBreakpointSize
'
).
mockReturnValue
(
'
xl
'
);
expect
(
domContentLoaded
()).
toBe
(
true
);
});
});
...
...
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