Commit 648a38d0 authored by Stan Hu's avatar Stan Hu

Merge branch '8745-geo-last-time-verified-on-geo-projects-page-shows-wrong-value' into 'master'

Geo - Show the proper label for the last repository check run on Geo projects page

See merge request gitlab-org/gitlab-ee!8844
parents ba6f92f5 f0f95974
......@@ -15,7 +15,7 @@
= s_('Geo|Never')
.col-sm.project-status-container
.project-status-title.text-muted
= s_('Geo|Last time verified')
= s_('Geo|Last repository check run')
.project-status-content
- if project_registry.last_repository_check_at
= time_ago_with_tooltip(project_registry.last_repository_check_at, placement: 'bottom')
......
---
title: Geo - Show the proper label for the last repository check run on Geo projects
page
merge_request: 8844
author:
type: fixed
......@@ -15,10 +15,8 @@ describe 'admin Geo Projects', :js, :geo do
end
describe 'visiting geo projects initial page' do
let(:page_url) { admin_geo_projects_path }
before do
visit(page_url)
visit(admin_geo_projects_path)
wait_for_requests
end
......@@ -48,7 +46,7 @@ describe 'admin Geo Projects', :js, :geo do
end
end
describe 'visiting specific tab in geo projects page' do
describe 'clicking on a specific tab in geo projects page' do
let(:page_url) { admin_geo_projects_path }
before do
......@@ -98,4 +96,65 @@ describe 'admin Geo Projects', :js, :geo do
end
end
end
shared_examples 'shows tab specific projects and correct labels' do
before do
visit(admin_geo_projects_path(sync_status: sync_status))
wait_for_requests
end
it 'shows tab specific projects' do
page.within(find('#content-body', match: :first)) do
expected_registries.each do |registry|
expect(page).to have_content(registry.project.full_name)
end
unexpected_registries.each do |registry|
expect(page).not_to have_content(registry.project.full_name)
end
end
page.within(find('.project-card', match: :first)) do
labels.each do |label|
expect(page).to have_content(label)
end
end
end
end
describe 'visiting geo synced projects page' do
let(:sync_status) { :synced }
let(:expected_registries) { [synced_registry] }
let(:unexpected_registries) { [sync_pending_registry, sync_failed_registry, never_synced_registry] }
let(:labels) { ['Status', 'Last successful sync', 'Last repository check run'] }
it_behaves_like 'shows tab specific projects and correct labels'
end
describe 'visiting geo pending synced projects page' do
let(:sync_status) { :pending }
let(:expected_registries) { [sync_pending_registry] }
let(:unexpected_registries) { [synced_registry, sync_failed_registry, never_synced_registry] }
let(:labels) { ['Status', 'Next sync scheduled at', 'Last sync attempt'] }
it_behaves_like 'shows tab specific projects and correct labels'
end
describe 'visiting geo never synced projects page' do
let(:sync_status) { :never }
let(:labels) { ['Status', 'Next sync scheduled at', 'Last sync attempt'] }
let(:expected_registries) { [never_synced_registry] }
let(:unexpected_registries) { [synced_registry, sync_pending_registry, sync_failed_registry] }
it_behaves_like 'shows tab specific projects and correct labels'
end
describe 'visiting geo failed sync projects page' do
let(:sync_status) { :failed }
let(:expected_registries) { [sync_failed_registry] }
let(:unexpected_registries) { [synced_registry, sync_pending_registry, never_synced_registry] }
let(:labels) { ['Status', 'Next sync scheduled at', 'Last sync attempt'] }
it_behaves_like 'shows tab specific projects and correct labels'
end
end
......@@ -4062,13 +4062,13 @@ msgstr ""
msgid "Geo|In sync"
msgstr ""
msgid "Geo|Last successful sync"
msgid "Geo|Last repository check run"
msgstr ""
msgid "Geo|Last sync attempt"
msgid "Geo|Last successful sync"
msgstr ""
msgid "Geo|Last time verified"
msgid "Geo|Last sync attempt"
msgstr ""
msgid "Geo|Never"
......
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