Commit c420ebd9 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch...

Merge branch '5971-geo-verification-information-section-shows-incorrect-data-values-for-the-primary-node-in-geo-admin-screen' into 'master'

Resolve "Geo: Verification information section shows incorrect data values for the primary node in Geo admin screen"

Closes #5971

See merge request gitlab-org/gitlab-ee!5722
parents 413370c6 7076e34a
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
primaryNodeDetailItems.push( primaryNodeDetailItems.push(
{ {
itemTitle: s__('GeoNodes|Repository checksum progress'), itemTitle: s__('GeoNodes|Repository checksum progress'),
itemValue: this.nodeDetails.verifiedRepositories, itemValue: this.nodeDetails.repositoriesChecksummed,
itemValueType: VALUE_TYPE.GRAPH, itemValueType: VALUE_TYPE.GRAPH,
successLabel: s__('GeoNodes|Checksummed'), successLabel: s__('GeoNodes|Checksummed'),
neutraLabel: s__('GeoNodes|Not checksummed'), neutraLabel: s__('GeoNodes|Not checksummed'),
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
}, },
{ {
itemTitle: s__('GeoNodes|Wiki checksum progress'), itemTitle: s__('GeoNodes|Wiki checksum progress'),
itemValue: this.nodeDetails.verifiedWikis, itemValue: this.nodeDetails.wikisChecksummed,
itemValueType: VALUE_TYPE.GRAPH, itemValueType: VALUE_TYPE.GRAPH,
successLabel: s__('GeoNodes|Checksummed'), successLabel: s__('GeoNodes|Checksummed'),
neutraLabel: s__('GeoNodes|Not checksummed'), neutraLabel: s__('GeoNodes|Not checksummed'),
......
...@@ -88,6 +88,16 @@ export default class GeoNodesStore { ...@@ -88,6 +88,16 @@ export default class GeoNodesStore {
failureCount: rawNodeDetails.wikis_failed_count || 0, failureCount: rawNodeDetails.wikis_failed_count || 0,
}, },
repositoryVerificationEnabled: rawNodeDetails.repository_verification_enabled, repositoryVerificationEnabled: rawNodeDetails.repository_verification_enabled,
repositoriesChecksummed: {
totalCount: rawNodeDetails.repositories_count || 0,
successCount: rawNodeDetails.repositories_checksummed_count || 0,
failureCount: rawNodeDetails.repositories_checksum_failed_count || 0,
},
wikisChecksummed: {
totalCount: rawNodeDetails.wikis_count || 0,
successCount: rawNodeDetails.wikis_checksummed_count || 0,
failureCount: rawNodeDetails.wikis_checksum_failed_count || 0,
},
verifiedRepositories: { verifiedRepositories: {
totalCount: rawNodeDetails.repositories_count || 0, totalCount: rawNodeDetails.repositories_count || 0,
successCount: rawNodeDetails.repositories_verified_count || 0, successCount: rawNodeDetails.repositories_verified_count || 0,
......
---
title: Shows the correct data in the verification information section for the primary node in Geo admin screen
merge_request: 5722
author:
type: fixed
...@@ -55,6 +55,54 @@ describe('NodeDetailsSectionVerification', () => { ...@@ -55,6 +55,54 @@ describe('NodeDetailsSectionVerification', () => {
}); });
}); });
describe('methods', () => {
describe('getPrimaryNodeDetailItems', () => {
const primaryItems = [
{
title: 'Repository checksum progress',
valueProp: 'repositoriesChecksummed',
},
{
title: 'Wiki checksum progress',
valueProp: 'wikisChecksummed',
},
{
title: 'Replication slots',
valueProp: 'replicationSlots',
},
];
it('returns array containing items to show under primary node', () => {
const actualPrimaryItems = vm.getPrimaryNodeDetailItems();
primaryItems.forEach((item, index) => {
expect(actualPrimaryItems[index].itemTitle).toBe(item.title);
expect(actualPrimaryItems[index].itemValue).toBe(mockNodeDetails[item.valueProp]);
});
});
});
describe('getSecondaryNodeDetailItems', () => {
const secondaryItems = [
{
title: 'Repository verification progress',
valueProp: 'verifiedRepositories',
},
{
title: 'Wiki verification progress',
valueProp: 'verifiedWikis',
},
];
it('returns array containing items to show under secondary node', () => {
const actualSecondaryItems = vm.getSecondaryNodeDetailItems();
secondaryItems.forEach((item, index) => {
expect(actualSecondaryItems[index].itemTitle).toBe(item.title);
expect(actualSecondaryItems[index].itemValue).toBe(mockNodeDetails[item.valueProp]);
});
});
});
});
describe('template', () => { describe('template', () => {
it('renders component container element', () => { it('renders component container element', () => {
expect(vm.$el.classList.contains('verification-section')).toBe(true); expect(vm.$el.classList.contains('verification-section')).toBe(true);
......
...@@ -86,6 +86,12 @@ export const rawMockNodeDetails = { ...@@ -86,6 +86,12 @@ export const rawMockNodeDetails = {
wikis_verification_failed_count: 0, wikis_verification_failed_count: 0,
wikis_verified_count: 12, wikis_verified_count: 12,
wikis_verified_in_percentage: '100.00%', wikis_verified_in_percentage: '100.00%',
repositories_checksummed_count: 12,
repositories_checksum_failed_count: 0,
repositories_checksummed_in_percentage: '100.00%',
wikis_checksummed_count: 12,
wikis_checksum_failed_count: 0,
wikis_checksummed_in_percentage: '100.00%',
replication_slots_count: null, replication_slots_count: null,
replication_slots_used_count: null, replication_slots_used_count: null,
replication_slots_used_in_percentage: '0.00%', replication_slots_used_in_percentage: '0.00%',
...@@ -176,14 +182,24 @@ export const mockNodeDetails = { ...@@ -176,14 +182,24 @@ export const mockNodeDetails = {
successCount: 0, successCount: 0,
failureCount: 0, failureCount: 0,
}, },
repositoriesChecksummed: {
totalCount: 12,
successCount: 12,
failureCount: 0,
},
wikisChecksummed: {
totalCount: 12,
successCount: 12,
failureCount: 0,
},
verifiedRepositories: { verifiedRepositories: {
totalCount: 0, totalCount: 12,
successCount: 0, successCount: 12,
failureCount: 0, failureCount: 0,
}, },
verifiedWikis: { verifiedWikis: {
totalCount: 0, totalCount: 12,
successCount: 0, successCount: 12,
failureCount: 0, failureCount: 0,
}, },
lastEvent: { lastEvent: {
......
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