Commit a11b4dae authored by Igor Drozdov's avatar Igor Drozdov

Merge branch '216535-show-accurate-last-successful-update' into 'master'

Show correct last successful update timestamp

Closes #216535

See merge request gitlab-org/gitlab!32078
parents 1ebb6a66 e41d2cd4
......@@ -11,7 +11,7 @@
%td= _('Pull')
%td
= import_state.last_update_started_at.present? ? time_ago_with_tooltip(import_state.last_update_started_at) : _('Never')
%td{ data: { qa_selector: 'mirror_last_update_at_cell' } }= import_state.last_update_at.present? ? time_ago_with_tooltip(import_state.last_update_at) : _('Never')
%td{ data: { qa_selector: 'mirror_last_update_at_cell' } }= import_state.last_successful_update_at.present? ? time_ago_with_tooltip(import_state.last_successful_update_at) : _('Never')
%td
- if import_state&.last_error.present?
.badge.badge-danger{ data: { toggle: 'tooltip', html: 'true' }, title: html_escape(import_state.last_error.try(:strip)) }= _('Error')
......
---
title: Show correct last successful update timestamp
merge_request: 32078
author:
type: fixed
......@@ -15,6 +15,34 @@ describe 'Project mirror', :js do
sign_in user
end
context 'when mirror was updated successfully' do
before do
import_state.update(last_successful_update_at: 5.minutes.ago)
end
it 'shows the last successful at timestamp' do
visit project_mirror_path(project)
page.within('.js-mirrors-table-body tr:nth-child(1) td:nth-child(4)') do
expect(page).to have_content('5 minutes ago')
end
end
end
context 'when mirror was never updated successfully' do
before do
import_state.update(last_successful_update_at: nil)
end
it 'shows that mirror has never been updated' do
visit project_mirror_path(project)
page.within('.js-mirrors-table-body tr:nth-child(1) td:nth-child(4)') do
expect(page).to have_content('Never')
end
end
end
context 'with Update now button' do
let(:timestamp) { Time.now }
......
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