Commit a0116677 authored by Kushal Pandya's avatar Kushal Pandya

Emit `onValueClick` event on component when container is clicked

parent c212908a
...@@ -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"
......
...@@ -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');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment