Skip to content

Commit

Permalink
add infinity test for #1177
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonwoodhull committed Jul 28, 2016
1 parent 704c2d5 commit 73b40db
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Do not allow pie slices to overlap pie labels, by Michael Dougherty ([#664](https://github.com/dc-js/dc.js/issues/664) / [#1167](https://github.com/dc-js/dc.js/pull/1167))
* Highlight pie slices when hovering labels and paths. (addressing a concern raised in commit [0a35ef61](https://github.com/dc-js/dc.js/pull/1167/commits/0a35ef61568baf8e84e0bc489f678df560dc7f31) in PR [#1167](https://github.com/dc-js/dc.js/pull/1167), but in a more robust way)
* Transition dots in line chart, by Paul Mach ([#1181](https://github.com/dc-js/dc.js/pull/1181))
* Number display was getting stuck on Infinity, by Xaser Acheron ([#1176](https://github.com/dc-js/dc.js/issues/1176) / [#1177](https://github.com/dc-js/dc.js/pull/1177))

## 2.0.0 beta 31
* Brush was sometimes not displaying, fix by Paul Briton ([#1134](https://github.com/dc-js/dc.js/issues/1134))
Expand Down
26 changes: 26 additions & 0 deletions spec/number-display-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,30 @@ describe('dc.numberDisplay', function () {
d3.select('#number-display-test-section').remove();
});
});
describe('Infinity', function () {
var chart;
beforeEach(function () {
var id = 'empty-div';
appendChartID(id);
chart = buildChart('#' + id);
chart.valueAccessor(function (x) { return x; })
.group({value: function () { return Infinity; }})
.formatNumber(function (d) { return d; })
.render();
d3.timer.flush();
});
it('should display as Infinity', function () {
expect(chart.root().text()).toEqual('Infinity');
});
describe('returning to finite', function () {
beforeEach(function () {
chart.group({value: function () { return 17; }})
.render();
d3.timer.flush();
});
it('should display finite', function () {
expect(chart.root().text()).toEqual('17');
});
});
});
});

0 comments on commit 73b40db

Please sign in to comment.