Commit aeabd307 authored by Filipa Lacerda's avatar Filipa Lacerda

Remove js classes from vue component that are not needed in vue component

parent 0d499ce2
...@@ -20,12 +20,6 @@ export default { ...@@ -20,12 +20,6 @@ export default {
default: 'top', default: 'top',
}, },
shortFormat: {
type: Boolean,
required: false,
default: false,
},
cssClass: { cssClass: {
type: String, type: String,
required: false, required: false,
...@@ -37,18 +31,12 @@ export default { ...@@ -37,18 +31,12 @@ export default {
tooltipMixin, tooltipMixin,
timeagoMixin, timeagoMixin,
], ],
computed: {
timeagoCssClass() {
return this.shortFormat ? 'js-short-timeago' : 'js-timeago';
},
},
}; };
</script> </script>
<template> <template>
<time <time
:class="[timeagoCssClass, cssClass]" :class="cssClass"
class="js-timeago js-timeago-render" class="js-vue-timeago"
:title="tooltipTitle(time)" :title="tooltipTitle(time)"
:data-placement="tooltipPlacement" :data-placement="tooltipPlacement"
data-container="body" data-container="body"
......
...@@ -22,7 +22,7 @@ describe('Time ago with tooltip component', () => { ...@@ -22,7 +22,7 @@ describe('Time ago with tooltip component', () => {
}).$mount(); }).$mount();
expect(vm.$el.tagName).toEqual('TIME'); expect(vm.$el.tagName).toEqual('TIME');
expect(vm.$el.classList.contains('js-timeago')).toEqual(true); expect(vm.$el.classList.contains('js-vue-timeago')).toEqual(true);
expect( expect(
vm.$el.getAttribute('data-original-title'), vm.$el.getAttribute('data-original-title'),
).toEqual(gl.utils.formatDate('2017-05-08T14:57:39.781Z')); ).toEqual(gl.utils.formatDate('2017-05-08T14:57:39.781Z'));
...@@ -44,17 +44,6 @@ describe('Time ago with tooltip component', () => { ...@@ -44,17 +44,6 @@ describe('Time ago with tooltip component', () => {
expect(vm.$el.getAttribute('data-placement')).toEqual('bottom'); expect(vm.$el.getAttribute('data-placement')).toEqual('bottom');
}); });
it('should render short format class', () => {
vm = new TimeagoTooltip({
propsData: {
time: '2017-05-08T14:57:39.781Z',
shortFormat: true,
},
}).$mount();
expect(vm.$el.classList.contains('js-short-timeago')).toEqual(true);
});
it('should render provided html class', () => { it('should render provided html class', () => {
vm = new TimeagoTooltip({ vm = new TimeagoTooltip({
propsData: { propsData: {
......
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