Commit 03e30155 authored by Enrique Alcántara's avatar Enrique Alcántara

Merge branch '249793_replace_bstooltip' into 'master'

Disable a custom tooltip initialization

See merge request gitlab-org/gitlab!46427
parents 7a5d64de be9f9938
......@@ -206,10 +206,6 @@ export const localTimeAgo = ($timeagoEls, setTimeago = true) => {
$timeagoEls.each((i, el) => {
// Recreate with custom template
el.setAttribute('title', formatDate(el.dateTime));
$(el).tooltip({
template:
'<div class="tooltip local-timeago" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',
});
});
}
......
......@@ -49,7 +49,7 @@ RSpec.describe 'Tooltips on .timeago dates', :js do
end
def datetime_in_tooltip
datetime_text = page.find('.local-timeago').text
datetime_text = page.find('.tooltip').text
DateTime.parse(datetime_text)
end
end
......@@ -24,7 +24,7 @@ RSpec.describe 'Pipeline Schedules', :js do
it 'displays the required information description' do
page.within('.pipeline-schedule-table-row') do
expect(page).to have_content('pipeline schedule')
expect(find(".next-run-cell time")['data-original-title'])
expect(find(".next-run-cell time")['title'])
.to include(pipeline_schedule.real_next_run.strftime('%b %-d, %Y'))
expect(page).to have_link('master')
expect(page).to have_link("##{pipeline.id}")
......
......@@ -643,16 +643,15 @@ describe('localTimeAgo', () => {
});
it.each`
timeagoArg | title | dataOriginalTitle
${false} | ${'some time'} | ${null}
${true} | ${''} | ${'Feb 18, 2020 10:22pm GMT+0000'}
`('converts $seconds seconds to $approximation', ({ timeagoArg, title, dataOriginalTitle }) => {
timeagoArg | title
${false} | ${'some time'}
${true} | ${'Feb 18, 2020 10:22pm GMT+0000'}
`('converts $seconds seconds to $approximation', ({ timeagoArg, title }) => {
const element = document.querySelector('time');
datetimeUtility.localTimeAgo($(element), timeagoArg);
jest.runAllTimers();
expect(element.getAttribute('data-original-title')).toBe(dataOriginalTitle);
expect(element.getAttribute('title')).toBe(title);
});
});
......
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