Commit a600dbbe authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch...

Merge branch '228997-replace-vue_shared-tooltip-with-gitlab-ui-s-tooltip-in-app-assets-javascripts' into 'master'

Migrate MR merged/closed time tooltip to GitLab UI

See merge request gitlab-org/gitlab!45137
parents 2d7b79bf af250f0d
<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