Commit af250f0d authored by Pedro Moreira da Silva's avatar Pedro Moreira da Silva Committed by Natalia Tepluhina

Migrate MR merged/closed time tooltip to GitLab UI

parent af5d7e13
<script>
import tooltip from '~/vue_shared/directives/tooltip';
import { GlTooltipDirective } from '@gitlab/ui';
import MrWidgetAuthor from './mr_widget_author.vue';
export default {
......@@ -8,7 +8,7 @@ export default {
MrWidgetAuthor,
},
directives: {
tooltip,
GlTooltip: GlTooltipDirective,
},
props: {
actionText: {
......@@ -34,6 +34,7 @@ export default {
<h4 class="js-mr-widget-author">
{{ actionText }}
<mr-widget-author :author="author" />
<time v-tooltip :title="dateTitle" data-container="body"> {{ dateReadable }} </time>
<span class="sr-only">{{ dateReadable }} ({{ dateTitle }})</span>
<time v-gl-tooltip.hover aria-hidden :title="dateTitle"> {{ dateReadable }} </time>
</h4>
</template>
......@@ -35,9 +35,7 @@ describe('MrWidgetAuthorTime', () => {
});
it('renders provided time', () => {
expect(vm.$el.querySelector('time').getAttribute('data-original-title')).toEqual(
'2017-03-23T23:02:00.807Z',
);
expect(vm.$el.querySelector('time').getAttribute('title')).toEqual('2017-03-23T23:02:00.807Z');
expect(vm.$el.querySelector('time').textContent.trim()).toEqual('12 hours ago');
});
......
......@@ -212,8 +212,6 @@ describe('MRWidgetMerged', () => {
});
it('should use mergedEvent mergedAt as tooltip title', () => {
expect(vm.$el.querySelector('time').getAttribute('data-original-title')).toBe(
'Jan 24, 2018 1:02pm GMT+0000',
);
expect(vm.$el.querySelector('time').getAttribute('title')).toBe('Jan 24, 2018 1:02pm GMT+0000');
});
});
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