Commit 69b87a97 authored by Fatih Acet's avatar Fatih Acet

Stop closing issue edit form in error state

parent 42f6be1b
......@@ -270,7 +270,6 @@ export default {
errMsg += `. ${response.data.errors.join(' ')}`;
}
eventHub.$emit('close.form');
createFlash(errMsg);
}
});
......@@ -295,7 +294,6 @@ export default {
visitUrl(data.web_url);
})
.catch(() => {
eventHub.$emit('close.form');
createFlash(
sprintf(s__('Error deleting %{issuableType}'), { issuableType: this.issuableType }),
);
......
......@@ -263,11 +263,11 @@ describe('Issuable output', () => {
describe('error when updating', () => {
it('closes form on error', done => {
spyOn(vm.service, 'updateIssuable').and.callFake(() => Promise.resolve());
spyOn(vm.service, 'updateIssuable').and.callFake(() => Promise.reject());
vm.updateIssuable();
setTimeout(() => {
expect(eventHub.$emit).toHaveBeenCalledWith('close.form');
expect(eventHub.$emit).not.toHaveBeenCalledWith('close.form');
expect(document.querySelector('.flash-container .flash-text').innerText.trim()).toBe(
`Error updating issue`,
);
......@@ -284,7 +284,7 @@ describe('Issuable output', () => {
vm.updateIssuable();
setTimeout(() => {
expect(eventHub.$emit).toHaveBeenCalledWith('close.form');
expect(eventHub.$emit).not.toHaveBeenCalledWith('close.form');
expect(document.querySelector('.flash-container .flash-text').innerText.trim()).toBe(
`Error updating merge request`,
);
......
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