Commit d58841d2 authored by Zack Cuddy's avatar Zack Cuddy Committed by Jose Ivan Vargas

Geo - Versions Error Fix

Version errors shouldn't show on the
primary node card.  This change adds a logic
check to ensure we only show version errors
on the secondary nodes.
parent fc70279b
...@@ -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,29 +85,55 @@ describe('GeoNodeDetailsComponent', () => { ...@@ -85,29 +85,55 @@ 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', () => {
beforeEach(() => { describe('when node is primary', () => {
createComponent({ beforeEach(() => {
nodeDetails: { createComponent({
...defaultProps.nodeDetails, node: {
primaryVersion: '10.3.0-pre', ...defaultProps.node,
primaryRevision: 'b93c51850b', primary: true,
}, },
nodeDetails: {
...defaultProps.nodeDetails,
primaryVersion: '10.3.0-pre',
primaryRevision: 'b93c51850b',
},
});
}); });
});
it('renders error message section', () => { it('does not render error message section', () => {
expect(findErrorSection().text()).toContain( expect(findErrorSection().exists()).toBe(false);
'GitLab version does not match the primary node version', });
);
}); });
it('renders troubleshooting URL within error message section', () => { describe('when node is secondary', () => {
expect(findTroubleshootingLink().attributes('href')).toBe('/foo/bar'); beforeEach(() => {
createComponent({
node: {
...defaultProps.node,
primary: false,
},
nodeDetails: {
...defaultProps.nodeDetails,
primaryVersion: '10.3.0-pre',
primaryRevision: 'b93c51850b',
},
});
});
it('renders error message section', () => {
expect(findErrorSection().text()).toContain(
'GitLab version does not match the primary node version',
);
});
it('renders troubleshooting URL within error message section', () => {
expect(findTroubleshootingLink().attributes('href')).toBe('/foo/bar');
});
}); });
}); });
}); });
......
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