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
a0116677
Commit
a0116677
authored
Apr 09, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Emit `onValueClick` event on component when container is clicked
parent
c212908a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_value_collapsed.vue
...onents/sidebar/labels_select/dropdown_value_collapsed.vue
+6
-0
spec/javascripts/vue_shared/components/sidebar/labels_select/dropdown_value_collapsed_spec.js
...ts/sidebar/labels_select/dropdown_value_collapsed_spec.js
+10
-0
No files found.
app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_value_collapsed.vue
View file @
a0116677
...
@@ -26,6 +26,11 @@ export default {
...
@@ -26,6 +26,11 @@ export default {
return
labelsString
;
return
labelsString
;
},
},
},
},
methods
:
{
handleClick
()
{
this
.
$emit
(
'
onValueClick
'
);
},
},
};
};
</
script
>
</
script
>
...
@@ -36,6 +41,7 @@ export default {
...
@@ -36,6 +41,7 @@ export default {
data-placement=
"left"
data-placement=
"left"
data-container=
"body"
data-container=
"body"
:title=
"labelsList"
:title=
"labelsList"
@
click=
"handleClick"
>
>
<i
<i
aria-hidden=
"true"
aria-hidden=
"true"
...
...
spec/javascripts/vue_shared/components/sidebar/labels_select/dropdown_value_collapsed_spec.js
View file @
a0116677
...
@@ -56,6 +56,16 @@ describe('DropdownValueCollapsedComponent', () => {
...
@@ -56,6 +56,16 @@ describe('DropdownValueCollapsedComponent', () => {
});
});
});
});
describe
(
'
methods
'
,
()
=>
{
describe
(
'
handleClick
'
,
()
=>
{
it
(
'
emits onValueClick event on component
'
,
()
=>
{
spyOn
(
vm
,
'
$emit
'
);
vm
.
handleClick
();
expect
(
vm
.
$emit
).
toHaveBeenCalledWith
(
'
onValueClick
'
);
});
});
});
describe
(
'
template
'
,
()
=>
{
describe
(
'
template
'
,
()
=>
{
it
(
'
renders component container element with tooltip`
'
,
()
=>
{
it
(
'
renders component container element with tooltip`
'
,
()
=>
{
expect
(
vm
.
$el
.
dataset
.
placement
).
toBe
(
'
left
'
);
expect
(
vm
.
$el
.
dataset
.
placement
).
toBe
(
'
left
'
);
...
...
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