summaryrefslogtreecommitdiffstats
path: root/server/sonar-web/tests
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-12-29 14:03:22 +0100
committerStas Vilchik <vilchiks@gmail.com>2015-12-29 14:05:27 +0100
commit458d8b33149bed4e3b1c0e579555734ee1d27b02 (patch)
tree37d985dc4b9f5bdc23312e911418ba472900920b /server/sonar-web/tests
parent87e9d4629cadbd59bb57bbd9c092931b7dd124c0 (diff)
downloadsonarqube-458d8b33149bed4e3b1c0e579555734ee1d27b02.tar.gz
sonarqube-458d8b33149bed4e3b1c0e579555734ee1d27b02.zip
SONAR-4004 handle failed requests
Diffstat (limited to 'server/sonar-web/tests')
-rw-r--r--server/sonar-web/tests/apps/code/store-test.js17
-rw-r--r--server/sonar-web/tests/jsdom-setup.js1
2 files changed, 17 insertions, 1 deletions
diff --git a/server/sonar-web/tests/apps/code/store-test.js b/server/sonar-web/tests/apps/code/store-test.js
index 9f883e7f8c6..dbff7efd961 100644
--- a/server/sonar-web/tests/apps/code/store-test.js
+++ b/server/sonar-web/tests/apps/code/store-test.js
@@ -7,7 +7,8 @@ import {
searchAction,
updateQueryAction,
startFetching,
- stopFetching
+ stopFetching,
+ raiseError
} from '../../../src/main/js/apps/code/actions';
@@ -207,6 +208,20 @@ describe('Code :: Store', () => {
.to.equal('');
});
});
+ describe('errorMessage', () => {
+ it('should be set', () => {
+ expect(current(initialState, raiseError('error!')).errorMessage)
+ .to.equal('error!');
+ });
+
+ it('should be reset', () => {
+ const stateBefore = Object.assign({}, initialState, { errorMessage: 'error!' });
+ expect(current(stateBefore, browseAction(exampleComponent)).errorMessage)
+ .to.be.null;
+ expect(current(stateBefore, searchAction(exampleComponents)).errorMessage)
+ .to.be.null;
+ });
+ });
});
describe('bucket', () => {
it('should add initial component', () => {
diff --git a/server/sonar-web/tests/jsdom-setup.js b/server/sonar-web/tests/jsdom-setup.js
index e911cbeb95b..f1d92d7d818 100644
--- a/server/sonar-web/tests/jsdom-setup.js
+++ b/server/sonar-web/tests/jsdom-setup.js
@@ -1,4 +1,5 @@
/* globals global: false */
+require("babel-polyfill");
var jsdom = require('jsdom');