aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/tests
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-03-07 15:54:05 +0100
committerStas Vilchik <vilchiks@gmail.com>2016-03-07 16:10:23 +0100
commit711c144b6dad1c6e245d1f86c5978dc9b8335155 (patch)
tree05c8aead0c0edc04a54521d4d2a65232897499db /server/sonar-web/tests
parentb5248a2c1c163d99e75b6e2bac56adc1a9dfa4ec (diff)
downloadsonarqube-711c144b6dad1c6e245d1f86c5978dc9b8335155.tar.gz
sonarqube-711c144b6dad1c6e245d1f86c5978dc9b8335155.zip
SONAR-7408 Drop "Technical Debt", "Coverage", "Duplications" and "Structure" pages
Diffstat (limited to 'server/sonar-web/tests')
-rw-r--r--server/sonar-web/tests/apps/overview/components/issues-tags-test.js45
-rw-r--r--server/sonar-web/tests/apps/overview/helpers/metrics-test.js110
2 files changed, 0 insertions, 155 deletions
diff --git a/server/sonar-web/tests/apps/overview/components/issues-tags-test.js b/server/sonar-web/tests/apps/overview/components/issues-tags-test.js
deleted file mode 100644
index 67d90c7c11f..00000000000
--- a/server/sonar-web/tests/apps/overview/components/issues-tags-test.js
+++ /dev/null
@@ -1,45 +0,0 @@
-import { expect } from 'chai';
-import React from 'react';
-import TestUtils from 'react-addons-test-utils';
-
-import { IssuesTags } from '../../../../src/main/js/apps/overview/components/issues-tags';
-import { WordCloud } from '../../../../src/main/js/components/charts/word-cloud';
-
-
-const COMPONENT = { key: 'component-key' };
-
-const TAGS = [
- { val: 'first', count: 3 },
- { val: 'second', count: 7000 },
- { val: 'third', count: 2 }
-];
-
-
-describe('IssuesTags', function () {
- it('should pass right data', function () {
- let renderer = TestUtils.createRenderer();
- renderer.render(<IssuesTags tags={TAGS} component={COMPONENT}/>);
- let output = renderer.getRenderOutput();
- expect(output.type).to.equal(WordCloud);
- expect(output.props.items).to.deep.equal([
- {
- "link": '/component_issues?id=component-key#resolved=false|tags=first',
- "size": 3,
- "text": 'first',
- "tooltip": 'Issues: 3'
- },
- {
- "link": '/component_issues?id=component-key#resolved=false|tags=second',
- "size": 7000,
- "text": 'second',
- "tooltip": 'Issues: 7k'
- },
- {
- "link": '/component_issues?id=component-key#resolved=false|tags=third',
- "size": 2,
- "text": 'third',
- "tooltip": 'Issues: 2'
- }
- ]);
- });
-});
diff --git a/server/sonar-web/tests/apps/overview/helpers/metrics-test.js b/server/sonar-web/tests/apps/overview/helpers/metrics-test.js
deleted file mode 100644
index e090ea54ed3..00000000000
--- a/server/sonar-web/tests/apps/overview/helpers/metrics-test.js
+++ /dev/null
@@ -1,110 +0,0 @@
-import { expect } from 'chai';
-
-import { filterMetrics, filterMetricsForDomains, getShortType, getMetricName } from
- '../../../../src/main/js/apps/overview/helpers/metrics';
-
-
-const METRICS = [
- { key: 'normal_metric', type: 'INT', hidden: false },
- { key: 'hidden_metric', type: 'INT', hidden: true },
- { key: 'DATA_metric', type: 'DATA', hidden: false },
- { key: 'DISTRIB_metric', type: 'DISTRIB', hidden: false },
- { key: 'new_metric', type: 'FLOAT', hidden: false }
-];
-
-
-describe('Overview Helpers', function () {
- describe('Metrics', function () {
-
- describe('#filterMetrics', function () {
- it('should filter out hidden metrics', function () {
- let metrics = [
- { key: 'normal_metric', type: 'INT', hidden: false },
- { key: 'hidden_metric', type: 'INT', hidden: true }
- ];
- expect(filterMetrics(metrics)).to.have.length(1);
- });
-
- it('should filter out DATA and DISTRIB metrics', function () {
- let metrics = [
- { key: 'normal_metric', type: 'INT', hidden: false },
- { key: 'DATA_metric', type: 'DATA', hidden: false },
- { key: 'DISTRIB_metric', type: 'DISTRIB', hidden: false }
- ];
- expect(filterMetrics(metrics)).to.have.length(1);
- });
-
- it('should filter out differential metrics', function () {
- let metrics = [
- { key: 'normal_metric', type: 'INT', hidden: false },
- { key: 'new_metric', type: 'FLOAT', hidden: false }
- ];
- expect(filterMetrics(metrics)).to.have.length(1);
- });
- });
-
- describe('#filterMetricsForDomains', function () {
- it('should filter out hidden metrics', function () {
- let metrics = [
- { key: 'normal_metric', type: 'INT', hidden: false, domain: 'first' },
- { key: 'hidden_metric', type: 'INT', hidden: true, domain: 'first' }
- ];
- expect(filterMetricsForDomains(metrics, ['first'])).to.have.length(1);
- });
-
- it('should filter out DATA and DISTRIB metrics', function () {
- let metrics = [
- { key: 'normal_metric', type: 'INT', hidden: false, domain: 'first' },
- { key: 'DATA_metric', type: 'DATA', hidden: false, domain: 'first' },
- { key: 'DISTRIB_metric', type: 'DISTRIB', hidden: false, domain: 'first' }
- ];
- expect(filterMetricsForDomains(metrics, ['first'])).to.have.length(1);
- });
-
- it('should filter out differential metrics', function () {
- let metrics = [
- { key: 'normal_metric', type: 'INT', hidden: false, domain: 'first' },
- { key: 'new_metric', type: 'FLOAT', hidden: false, domain: 'first' }
- ];
- expect(filterMetricsForDomains(metrics, ['first'])).to.have.length(1);
- });
-
- it('should filter metrics by domains', function () {
- let metrics = [
- { key: 'normal_metric', type: 'INT', hidden: false, domain: 'first' },
- { key: 'normal_metric1', type: 'INT', hidden: false, domain: 'second' },
- { key: 'normal_metric2', type: 'INT', hidden: false, domain: 'third' },
- { key: 'normal_metric3', type: 'INT', hidden: false, domain: 'second' }
- ];
- expect(filterMetricsForDomains(metrics, ['first', 'second'])).to.have.length(3);
- });
- });
-
-
- describe('#getShortType', function () {
- it('should shorten INT', function () {
- expect(getShortType('INT')).to.equal('SHORT_INT');
- });
-
- it('should shorten WORK_DUR', function () {
- expect(getShortType('WORK_DUR')).to.equal('SHORT_WORK_DUR');
- });
-
- it('should not shorten FLOAT', function () {
- expect(getShortType('FLOAT')).to.equal('FLOAT');
- });
-
- it('should not shorten PERCENT', function () {
- expect(getShortType('PERCENT')).to.equal('PERCENT');
- });
- });
-
-
- describe('#getMetricName', function () {
- it('should return metric name', function () {
- expect(getMetricName('metric_name')).to.equal('overview.metric.metric_name');
- });
- });
-
- });
-});