Commit 6e47cfd9 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch '197986-fix-geo-error-message' into 'master'

Geo - Versions Error Fix

Closes #197986

See merge request gitlab-org/gitlab!36984
parents 9ae14126 d58841d2
...@@ -51,7 +51,7 @@ export default { ...@@ -51,7 +51,7 @@ export default {
errorMessage() { errorMessage() {
if (!this.nodeDetails.healthy) { if (!this.nodeDetails.healthy) {
return this.nodeDetails.health; return this.nodeDetails.health;
} else if (this.hasVersionMismatch) { } else if (!this.node.primary && this.hasVersionMismatch) {
return s__('GeoNodes|GitLab version does not match the primary node version'); return s__('GeoNodes|GitLab version does not match the primary node version');
} }
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
:node-details="nodeDetails" :node-details="nodeDetails"
:node-type-primary="node.primary" :node-type-primary="node.primary"
/> />
<div v-if="errorMessage"> <div v-if="errorMessage" data-testid="errorSection">
<p class="p-3 mb-0 bg-danger-100 text-danger-500"> <p class="p-3 mb-0 bg-danger-100 text-danger-500">
{{ errorMessage }} {{ errorMessage }}
<gl-link :href="geoTroubleshootingHelpPath">{{ <gl-link :href="geoTroubleshootingHelpPath">{{
......
---
title: Geo - Update version errors
merge_request: 36984
author:
type: fixed
...@@ -33,7 +33,7 @@ describe('GeoNodeDetailsComponent', () => { ...@@ -33,7 +33,7 @@ describe('GeoNodeDetailsComponent', () => {
wrapper.destroy(); wrapper.destroy();
}); });
const findErrorSection = () => wrapper.find('.bg-danger-100'); const findErrorSection = () => wrapper.find('[data-testid="errorSection"]');
const findTroubleshootingLink = () => findErrorSection().find(GlLink); const findTroubleshootingLink = () => findErrorSection().find(GlLink);
describe('template', () => { describe('template', () => {
...@@ -74,7 +74,7 @@ describe('GeoNodeDetailsComponent', () => { ...@@ -74,7 +74,7 @@ describe('GeoNodeDetailsComponent', () => {
}); });
it('does not render error message section', () => { it('does not render error message section', () => {
expect(findErrorSection().exists()).toBeFalsy(); expect(findErrorSection().exists()).toBe(false);
}); });
}); });
}); });
...@@ -85,13 +85,38 @@ describe('GeoNodeDetailsComponent', () => { ...@@ -85,13 +85,38 @@ describe('GeoNodeDetailsComponent', () => {
}); });
it('does not render error message section', () => { it('does not render error message section', () => {
expect(findErrorSection().exists()).toBeFalsy(); expect(findErrorSection().exists()).toBe(false);
}); });
}); });
describe('when version mismatched', () => { describe('when version mismatched', () => {
describe('when node is primary', () => {
beforeEach(() => { beforeEach(() => {
createComponent({ createComponent({
node: {
...defaultProps.node,
primary: true,
},
nodeDetails: {
...defaultProps.nodeDetails,
primaryVersion: '10.3.0-pre',
primaryRevision: 'b93c51850b',
},
});
});
it('does not render error message section', () => {
expect(findErrorSection().exists()).toBe(false);
});
});
describe('when node is secondary', () => {
beforeEach(() => {
createComponent({
node: {
...defaultProps.node,
primary: false,
},
nodeDetails: { nodeDetails: {
...defaultProps.nodeDetails, ...defaultProps.nodeDetails,
primaryVersion: '10.3.0-pre', primaryVersion: '10.3.0-pre',
...@@ -111,4 +136,5 @@ describe('GeoNodeDetailsComponent', () => { ...@@ -111,4 +136,5 @@ describe('GeoNodeDetailsComponent', () => {
}); });
}); });
}); });
});
}); });
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