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 {
errorMessage() {
if (!this.nodeDetails.healthy) {
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');
}
......@@ -82,7 +82,7 @@ export default {
:node-details="nodeDetails"
: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">
{{ errorMessage }}
<gl-link :href="geoTroubleshootingHelpPath">{{
......
---
title: Geo - Update version errors
merge_request: 36984
author:
type: fixed
......@@ -33,7 +33,7 @@ describe('GeoNodeDetailsComponent', () => {
wrapper.destroy();
});
const findErrorSection = () => wrapper.find('.bg-danger-100');
const findErrorSection = () => wrapper.find('[data-testid="errorSection"]');
const findTroubleshootingLink = () => findErrorSection().find(GlLink);
describe('template', () => {
......@@ -74,7 +74,7 @@ describe('GeoNodeDetailsComponent', () => {
});
it('does not render error message section', () => {
expect(findErrorSection().exists()).toBeFalsy();
expect(findErrorSection().exists()).toBe(false);
});
});
});
......@@ -85,29 +85,55 @@ describe('GeoNodeDetailsComponent', () => {
});
it('does not render error message section', () => {
expect(findErrorSection().exists()).toBeFalsy();
expect(findErrorSection().exists()).toBe(false);
});
});
describe('when version mismatched', () => {
beforeEach(() => {
createComponent({
nodeDetails: {
...defaultProps.nodeDetails,
primaryVersion: '10.3.0-pre',
primaryRevision: 'b93c51850b',
},
describe('when node is primary', () => {
beforeEach(() => {
createComponent({
node: {
...defaultProps.node,
primary: true,
},
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('does not render error message section', () => {
expect(findErrorSection().exists()).toBe(false);
});
});
it('renders troubleshooting URL within error message section', () => {
expect(findTroubleshootingLink().attributes('href')).toBe('/foo/bar');
describe('when node is secondary', () => {
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