Adds props to allow tooltip config. Breaks tests into specific cases
This commit is contained in:
parent
e331ca13e5
commit
0d99f6c620
|
@ -18,6 +18,16 @@
|
|||
type: String,
|
||||
required: true,
|
||||
},
|
||||
tooltipPlacement: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'top',
|
||||
},
|
||||
tooltipContainer: {
|
||||
type: [String, Boolean],
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -29,6 +39,8 @@
|
|||
:title="title"
|
||||
:data-clipboard-text="text"
|
||||
v-tooltip
|
||||
:data-container="tooltipContainer"
|
||||
:data-placement="tooltipPlacement"
|
||||
>
|
||||
<i
|
||||
aria-hidden="true"
|
||||
|
|
|
@ -17,9 +17,15 @@ describe('clipboard button', () => {
|
|||
vm.$destroy();
|
||||
});
|
||||
|
||||
it('renders a button for clipboard with a tooltip', () => {
|
||||
it('renders a button for clipboard', () => {
|
||||
expect(vm.$el.tagName).toEqual('BUTTON');
|
||||
expect(vm.$el.getAttribute('data-clipboard-text')).toEqual('copy me');
|
||||
expect(vm.$el.querySelector('i').className).toEqual('fa fa-clipboard');
|
||||
});
|
||||
|
||||
it('should have a tooltip with default values', () => {
|
||||
expect(vm.$el.getAttribute('data-original-title')).toEqual('Copy this value into Clipboard!');
|
||||
expect(vm.$el.getAttribute('data-placement')).toEqual('top');
|
||||
expect(vm.$el.getAttribute('data-container')).toEqual(null);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue