aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/tests/apps
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-11-18 15:29:36 +0100
committerStas Vilchik <vilchiks@gmail.com>2015-11-18 15:29:43 +0100
commit474e611f9c8fb89b1b4025a0bf26812d4dde291e (patch)
treebc6c4e8bf567d9889e80da8a19f12ccfee64cf5b /server/sonar-web/tests/apps
parent5934fd7d5566968f395b6dcf4658bad241d28825 (diff)
downloadsonarqube-474e611f9c8fb89b1b4025a0bf26812d4dde291e.tar.gz
sonarqube-474e611f9c8fb89b1b4025a0bf26812d4dde291e.zip
fix SONAR-7041 Overview page fails when period date is empty
Diffstat (limited to 'server/sonar-web/tests/apps')
-rw-r--r--server/sonar-web/tests/apps/overview/helpers/periods-test.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/server/sonar-web/tests/apps/overview/helpers/periods-test.js b/server/sonar-web/tests/apps/overview/helpers/periods-test.js
index ee50b3c805d..bd9b3a41e05 100644
--- a/server/sonar-web/tests/apps/overview/helpers/periods-test.js
+++ b/server/sonar-web/tests/apps/overview/helpers/periods-test.js
@@ -17,6 +17,13 @@ const PERIOD_WITHOUT_VERSION = {
modeParam: ''
};
+const PERIOD_WITHOUT_DATE = {
+ date: '',
+ index: '1',
+ mode: 'previous_version',
+ modeParam: ''
+};
+
describe('Overview Helpers', function () {
describe('Periods', function () {
@@ -27,10 +34,15 @@ describe('Overview Helpers', function () {
expect(result.getFullYear()).to.equal(2015);
});
- it('should return null', function () {
+ it('should return null when can not find period', function () {
let result = getPeriodDate([], '1');
expect(result).to.be.null;
});
+
+ it('should return null when date is empty', function () {
+ let result = getPeriodDate([PERIOD_WITHOUT_DATE], '1');
+ expect(result).to.be.null;
+ });
});