diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-02-25 11:37:27 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2016-02-25 11:37:27 +0100 |
commit | de93484b491259604bfb663bf73a36bea476ec4b (patch) | |
tree | b5623aa8cfe4bcdd922d87ba4aeb996d4e47ab6f /server/sonar-web/tests | |
parent | d4c6dff219bdf98411f1cb9422aa2c1bfd83abb2 (diff) | |
download | sonarqube-de93484b491259604bfb663bf73a36bea476ec4b.tar.gz sonarqube-de93484b491259604bfb663bf73a36bea476ec4b.zip |
improve display of little language distribution percentage on the overview page
Diffstat (limited to 'server/sonar-web/tests')
-rw-r--r-- | server/sonar-web/tests/apps/overview/components/language-distribution-test.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/server/sonar-web/tests/apps/overview/components/language-distribution-test.js b/server/sonar-web/tests/apps/overview/components/language-distribution-test.js index a54ba2b1260..cf5740daa55 100644 --- a/server/sonar-web/tests/apps/overview/components/language-distribution-test.js +++ b/server/sonar-web/tests/apps/overview/components/language-distribution-test.js @@ -35,4 +35,15 @@ describe('LanguageDistribution', function () { it('should pass right yValues', function () { expect(props.yValues).to.deep.equal(['19.4%', '2.1%', '1.7%']); }); + + it('should correctly render very small values', function () { + const DISTRIBUTION_SMALL = 'java=194342;js=999'; + + let renderer = TestUtils.createRenderer(); + renderer.render(<LanguageDistribution distribution={DISTRIBUTION_SMALL} lines={LINES}/>); + let output = renderer.getRenderOutput(); + let child = React.Children.only(output.props.children); + + expect(child.props.yValues).to.deep.equal(['19.4%', '<0.1%']); + }); }); |