Commit 64174a7c authored by Tom Quirk's avatar Tom Quirk

Addressing reviewer feedback

- clean up error messages
- default errorMessage to ''
- Test for no GlAlert in default case
parent 32ecd919
...@@ -52,7 +52,7 @@ export default { ...@@ -52,7 +52,7 @@ export default {
}, },
projectPath: '', projectPath: '',
issueId: '', issueId: '',
errorMessage: null, errorMessage: '',
}; };
}, },
apollo: { apollo: {
......
...@@ -2,7 +2,7 @@ import { __, s__, sprintf } from '~/locale'; ...@@ -2,7 +2,7 @@ import { __, s__, sprintf } from '~/locale';
export const designDeletionError = ({ singular = true } = {}) => { export const designDeletionError = ({ singular = true } = {}) => {
const design = singular ? __('a design') : __('designs'); const design = singular ? __('a design') : __('designs');
return sprintf(s__('DesignManagement|We could not delete %{design}. Please try again.'), { return sprintf(s__('DesignManagement|Could not delete %{design}. Please try again'), {
design, design,
}); });
}; };
...@@ -15,7 +15,7 @@ export const ADD_IMAGE_DIFF_NOTE_ERROR = s__( ...@@ -15,7 +15,7 @@ export const ADD_IMAGE_DIFF_NOTE_ERROR = s__(
export const UPLOAD_DESIGN_ERROR = s__( export const UPLOAD_DESIGN_ERROR = s__(
'DesignManagement|Error uploading a new design. Please try again', 'DesignManagement|Error uploading a new design. Please try again',
); );
export const DESIGN_NOT_FOUND_ERROR = s__('DesignManagement|Could not find design.'); export const DESIGN_NOT_FOUND_ERROR = s__('DesignManagement|Could not find design');
export const DESIGN_NOT_EXIST_ERROR = s__( export const DESIGN_NOT_EXIST_ERROR = s__(
'DesignManagement|Requested design version does not exist', 'DesignManagement|Requested design version does not exist',
); );
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlAlert } from '@gitlab/ui';
import { ApolloMutation } from 'vue-apollo'; import { ApolloMutation } from 'vue-apollo';
import DesignIndex from 'ee/design_management/pages/design/index.vue'; import DesignIndex from 'ee/design_management/pages/design/index.vue';
import DesignDiscussion from 'ee/design_management/components/design_notes/design_discussion.vue'; import DesignDiscussion from 'ee/design_management/components/design_notes/design_discussion.vue';
...@@ -91,6 +92,7 @@ describe('Design management design index page', () => { ...@@ -91,6 +92,7 @@ describe('Design management design index page', () => {
}); });
expect(wrapper.element).toMatchSnapshot(); expect(wrapper.element).toMatchSnapshot();
expect(wrapper.find(GlAlert)).toBeUndefined();
}); });
describe('when has no discussions', () => { describe('when has no discussions', () => {
...@@ -176,7 +178,7 @@ describe('Design management design index page', () => { ...@@ -176,7 +178,7 @@ describe('Design management design index page', () => {
}); });
}); });
describe('flash', () => { describe('with error', () => {
beforeEach(() => { beforeEach(() => {
setDesign(); setDesign();
......
...@@ -6023,7 +6023,10 @@ msgstr "" ...@@ -6023,7 +6023,10 @@ msgstr ""
msgid "DesignManagement|Could not create new discussion. Please try again." msgid "DesignManagement|Could not create new discussion. Please try again."
msgstr "" msgstr ""
msgid "DesignManagement|Could not find design." msgid "DesignManagement|Could not delete %{design}. Please try again"
msgstr ""
msgid "DesignManagement|Could not find design"
msgstr "" msgstr ""
msgid "DesignManagement|Delete" msgid "DesignManagement|Delete"
...@@ -6068,9 +6071,6 @@ msgstr "" ...@@ -6068,9 +6071,6 @@ msgstr ""
msgid "DesignManagement|Upload and view the latest designs for this issue. Consistent and easy to find, so everyone is up to date." msgid "DesignManagement|Upload and view the latest designs for this issue. Consistent and easy to find, so everyone is up to date."
msgstr "" msgstr ""
msgid "DesignManagement|We could not delete %{design}. Please try again."
msgstr ""
msgid "Designs" msgid "Designs"
msgstr "" msgstr ""
......
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