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
667cd625
Commit
667cd625
authored
Oct 18, 2017
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved Var Caching, Line Setup, Specs
parent
8e828bef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
18 deletions
+20
-18
app/assets/javascripts/pipelines/components/graph/action_component.vue
...vascripts/pipelines/components/graph/action_component.vue
+3
-3
app/assets/javascripts/pipelines/components/graph/dropdown_action_component.vue
.../pipelines/components/graph/dropdown_action_component.vue
+1
-2
spec/javascripts/vue_shared/components/icon_spec.js
spec/javascripts/vue_shared/components/icon_spec.js
+16
-13
No files found.
app/assets/javascripts/pipelines/components/graph/action_component.vue
View file @
667cd625
...
...
@@ -39,7 +39,8 @@
computed
:
{
cssClass
()
{
return
`
${
gl
.
text
.
dasherize
(
this
.
actionIcon
)}
js-icon-
${
gl
.
text
.
dasherize
(
this
.
actionIcon
)}
`
;
const
actionIconDash
=
gl
.
text
.
dasherize
(
this
.
actionIcon
)
return
`
${
actionIconDash
}
js-icon-
${
actionIconDash
}
`
;
},
},
};
...
...
@@ -53,7 +54,6 @@
class=
"ci-action-icon-container ci-action-icon-wrapper"
:class=
"cssClass"
data-container=
"body"
>
<icon
:name=
"actionIcon"
/>
<icon
:name=
"actionIcon"
/>
</a>
</
template
>
app/assets/javascripts/pipelines/components/graph/dropdown_action_component.vue
View file @
667cd625
...
...
@@ -48,7 +48,6 @@
class=
"ci-action-icon-wrapper js-ci-status-icon"
data-container=
"body"
aria-label=
"Job's action"
>
<icon
:name=
"actionIcon"
/>
<icon
:name=
"actionIcon"
/>
</a>
</
template
>
spec/javascripts/vue_shared/components/icon_spec.js
View file @
667cd625
import
Vue
from
'
vue
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
const
IconComponent
=
Vue
.
extend
(
Icon
);
import
mountComponent
from
'
../../helpers/vue_mount_component_helper
'
;
describe
(
'
Sprite Icon Component
'
,
function
()
{
describe
(
'
Initialization
'
,
function
()
{
let
icon
;
beforeEach
(
function
()
{
this
.
propsData
=
{
const
IconComponent
=
Vue
.
extend
(
Icon
);
icon
=
mountComponent
(
IconComponent
,
{
name
:
'
test
'
,
size
:
99
,
cssClasses
:
'
extraclasses
'
,
};
});
});
this
.
icon
=
new
IconComponent
({
propsData
:
this
.
propsData
,
}).
$mount
();
afterEach
(()
=>
{
icon
.
$destroy
();
});
it
(
'
should return a defined Vue component
'
,
function
()
{
expect
(
this
.
icon
).
toBeDefined
();
expect
(
icon
).
toBeDefined
();
});
it
(
'
should have <svg> as a child element
'
,
function
()
{
expect
(
this
.
icon
.
$el
.
tagName
).
toBe
(
'
svg
'
);
expect
(
icon
.
$el
.
tagName
).
toBe
(
'
svg
'
);
});
it
(
'
should have <use> as a child element with the correct href
'
,
function
()
{
expect
(
this
.
icon
.
$el
.
firstChild
.
tagName
).
toBe
(
'
use
'
);
expect
(
this
.
icon
.
$el
.
firstChild
.
getAttribute
(
'
xlink:href
'
)).
toBe
(
`
${
gon
.
sprite_icons
}
#test`
);
expect
(
icon
.
$el
.
firstChild
.
tagName
).
toBe
(
'
use
'
);
expect
(
icon
.
$el
.
firstChild
.
getAttribute
(
'
xlink:href
'
)).
toBe
(
`
${
gon
.
sprite_icons
}
#test`
);
});
it
(
'
should properly compute iconSizeClass
'
,
function
()
{
expect
(
this
.
icon
.
iconSizeClass
).
toBe
(
'
s99
'
);
expect
(
icon
.
iconSizeClass
).
toBe
(
'
s99
'
);
});
it
(
'
should properly render img css
'
,
function
()
{
const
classList
=
this
.
icon
.
$el
.
classList
;
const
classList
=
icon
.
$el
.
classList
;
const
containsSizeClass
=
classList
.
contains
(
'
s99
'
);
const
containsCustomClass
=
classList
.
contains
(
'
extraclasses
'
);
expect
(
containsSizeClass
).
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