Skip to content

Commit 73b40db

Browse files
add infinity test for #1177
1 parent 704c2d5 commit 73b40db

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

Changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* 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))
1010
* 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)
1111
* Transition dots in line chart, by Paul Mach ([#1181](https://github.com/dc-js/dc.js/pull/1181))
12+
* 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))
1213

1314
## 2.0.0 beta 31
1415
* Brush was sometimes not displaying, fix by Paul Briton ([#1134](https://github.com/dc-js/dc.js/issues/1134))

spec/number-display-spec.js

+26
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,30 @@ describe('dc.numberDisplay', function () {
165165
d3.select('#number-display-test-section').remove();
166166
});
167167
});
168+
describe('Infinity', function () {
169+
var chart;
170+
beforeEach(function () {
171+
var id = 'empty-div';
172+
appendChartID(id);
173+
chart = buildChart('#' + id);
174+
chart.valueAccessor(function (x) { return x; })
175+
.group({value: function () { return Infinity; }})
176+
.formatNumber(function (d) { return d; })
177+
.render();
178+
d3.timer.flush();
179+
});
180+
it('should display as Infinity', function () {
181+
expect(chart.root().text()).toEqual('Infinity');
182+
});
183+
describe('returning to finite', function () {
184+
beforeEach(function () {
185+
chart.group({value: function () { return 17; }})
186+
.render();
187+
d3.timer.flush();
188+
});
189+
it('should display finite', function () {
190+
expect(chart.root().text()).toEqual('17');
191+
});
192+
});
193+
});
168194
});

0 commit comments

Comments
 (0)