Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/javascripts/importer_status_spec.js')
-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', () => {