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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
22a120a2
Commit
22a120a2
authored
Oct 17, 2017
by
Clement Ho
Committed by
Phil Hughes
Oct 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve sprite icon spec
parent
89f5ede2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
10 deletions
+18
-10
spec/javascripts/lib/utils/common_utils_spec.js
spec/javascripts/lib/utils/common_utils_spec.js
+18
-10
No files found.
spec/javascripts/lib/utils/common_utils_spec.js
View file @
22a120a2
...
...
@@ -467,19 +467,27 @@ describe('common_utils', () => {
commonUtils
.
ajaxPost
(
requestURL
,
data
);
expect
(
ajaxSpy
.
calls
.
allArgs
()[
0
][
0
].
type
).
toEqual
(
'
POST
'
);
});
});
describe
(
'
spriteIcon
'
,
()
=>
{
let
beforeGon
;
describe
(
'
gl.utils.spriteIcon
'
,
()
=>
{
beforeEach
(()
=>
{
window
.
gon
=
window
.
gon
||
{};
beforeGon
=
Object
.
assign
({},
window
.
gon
);
window
.
gon
.
sprite_icons
=
'
icons.svg
'
;
});
afterEach
(()
=>
{
window
.
gon
=
beforeGon
;
});
it
(
'
should return the svg for a linked icon
'
,
()
=>
{
expect
(
gl
.
u
tils
.
spriteIcon
(
'
test
'
)).
toEqual
(
'
<svg ><use xlink:href="icons.svg#test" /></svg>
'
);
expect
(
commonU
tils
.
spriteIcon
(
'
test
'
)).
toEqual
(
'
<svg ><use xlink:href="icons.svg#test" /></svg>
'
);
});
it
(
'
should set svg className when passed
'
,
()
=>
{
expect
(
gl
.
utils
.
spriteIcon
(
'
test
'
,
'
fa fa-test
'
)).
toEqual
(
'
<svg class="fa fa-test"><use xlink:href="icons.svg#test" /></svg>
'
);
});
expect
(
commonUtils
.
spriteIcon
(
'
test
'
,
'
fa fa-test
'
)).
toEqual
(
'
<svg class="fa fa-test"><use xlink:href="icons.svg#test" /></svg>
'
);
});
});
});
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