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 {
},
projectPath: '',
issueId: '',
errorMessage: null,
errorMessage: '',
};
},
apollo: {
......
......@@ -2,7 +2,7 @@ import { __, s__, sprintf } from '~/locale';
export const designDeletionError = ({ singular = true } = {}) => {
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,
});
};
......@@ -15,7 +15,7 @@ export const ADD_IMAGE_DIFF_NOTE_ERROR = s__(
export const UPLOAD_DESIGN_ERROR = s__(
'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__(
'DesignManagement|Requested design version does not exist',
);
import { shallowMount } from '@vue/test-utils';
import { GlAlert } from '@gitlab/ui';
import { ApolloMutation } from 'vue-apollo';
import DesignIndex from 'ee/design_management/pages/design/index.vue';
import DesignDiscussion from 'ee/design_management/components/design_notes/design_discussion.vue';
......@@ -91,6 +92,7 @@ describe('Design management design index page', () => {
});
expect(wrapper.element).toMatchSnapshot();
expect(wrapper.find(GlAlert)).toBeUndefined();
});
describe('when has no discussions', () => {
......@@ -176,7 +178,7 @@ describe('Design management design index page', () => {
});
});
describe('flash', () => {
describe('with error', () => {
beforeEach(() => {
setDesign();
......
......@@ -6023,7 +6023,10 @@ msgstr ""
msgid "DesignManagement|Could not create new discussion. Please try again."
msgstr ""
msgid "DesignManagement|Could not find design."
msgid "DesignManagement|Could not delete %{design}. Please try again"
msgstr ""
msgid "DesignManagement|Could not find design"
msgstr ""
msgid "DesignManagement|Delete"
......@@ -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."
msgstr ""
msgid "DesignManagement|We could not delete %{design}. Please try again."
msgstr ""
msgid "Designs"
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