Commit 0d99f6c6 authored by Filipa Lacerda's avatar Filipa Lacerda

Adds props to allow tooltip config. Breaks tests into specific cases

parent e331ca13
...@@ -18,6 +18,16 @@ ...@@ -18,6 +18,16 @@
type: String, type: String,
required: true, required: true,
}, },
tooltipPlacement: {
type: String,
required: false,
default: 'top',
},
tooltipContainer: {
type: [String, Boolean],
required: false,
default: false,
},
}, },
}; };
</script> </script>
...@@ -29,6 +39,8 @@ ...@@ -29,6 +39,8 @@
:title="title" :title="title"
:data-clipboard-text="text" :data-clipboard-text="text"
v-tooltip v-tooltip
:data-container="tooltipContainer"
:data-placement="tooltipPlacement"
> >
<i <i
aria-hidden="true" aria-hidden="true"
......
...@@ -17,9 +17,15 @@ describe('clipboard button', () => { ...@@ -17,9 +17,15 @@ describe('clipboard button', () => {
vm.$destroy(); 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.tagName).toEqual('BUTTON');
expect(vm.$el.getAttribute('data-clipboard-text')).toEqual('copy me'); 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-original-title')).toEqual('Copy this value into Clipboard!');
expect(vm.$el.getAttribute('data-placement')).toEqual('top');
expect(vm.$el.getAttribute('data-container')).toEqual(null);
}); });
}); });
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