summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2018-06-06 11:41:22 +0000
committerFatih Acet <acetfatih@gmail.com>2018-06-06 11:41:22 +0000
commitddabde5446a68d4717ed8d42431a480c7a68a8a9 (patch)
treede66cd119db386b8ec6e8e1d5e387acddb3bf68b /spec/javascripts
parentb995b0319147a068092afc21fc2f1f3ff044a143 (diff)
parent332275b766283ff65d0637ada3e4080c3cd4f038 (diff)
downloadgitlab-ce-ddabde5446a68d4717ed8d42431a480c7a68a8a9.tar.gz
Merge branch 'sh-improve-import-status-error' into 'master'
Show a more helpful error for import status Closes #47365 See merge request gitlab-org/gitlab-ce!19467
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/importer_status_spec.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/javascripts/importer_status_spec.js b/spec/javascripts/importer_status_spec.js
index 87b46ccf7c3..63cdb3d5114 100644
--- a/spec/javascripts/importer_status_spec.js
+++ b/spec/javascripts/importer_status_spec.js
@@ -50,6 +50,24 @@ describe('Importer Status', () => {
})
.catch(done.fail);
});
+
+ it('shows error message after failed POST request', (done) => {
+ appendSetFixtures('<div class="flash-container"></div>');
+
+ mock.onPost(importUrl).reply(422, {
+ errors: 'You forgot your lunch',
+ });
+
+ instance.addToImport({
+ currentTarget: document.querySelector('.js-add-to-import'),
+ })
+ .then(() => {
+ const flashMessage = document.querySelector('.flash-text');
+ expect(flashMessage.textContent.trim()).toEqual('An error occurred while importing project: You forgot your lunch');
+ done();
+ })
+ .catch(done.fail);
+ });
});
describe('autoUpdate', () => {