Skip to content

Commit

Permalink
negative and positive tests for .xyTipsOn
Browse files Browse the repository at this point in the history
fixes #1152
  • Loading branch information
gordonwoodhull committed Dec 1, 2016
1 parent 081defb commit 3a90e89
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,4 @@ Michael Dougherty <maackle.d@gmail.com>
Paul Mach <paulmach@gmail.com>
Fil <fil@rezo.net>
Mauricio Bustos <m@bustos.org>
Anders Dalvander <github@dalvander.com>
26 changes: 26 additions & 0 deletions spec/line-chart-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,32 @@ describe('dc.lineChart', function () {

});

describe('title rendering with brushOn', function () {
beforeEach(function () {
chart.brushOn(true)
.xyTipsOn(true); // default, for exposition
chart.render();
});

it('should not render tips', function () {
expect(chart.select('.dc-tooltip._0 .dot').empty()).toBeTruthy();
expect(chart.select('.dc-tooltip._0 .dot title').empty()).toBeTruthy();
});

describe('with xyTipsOn always', function () {
beforeEach(function () {
chart.brushOn(true)
.xyTipsOn('always');
chart.render();
});

it('should render dots', function () {
expect(chart.select('.dc-tooltip._0 .dot').empty()).toBeFalsy();
expect(chart.select('.dc-tooltip._0 .dot title').empty()).toBeFalsy();
});
});
});

describe('label rendering off', function () {
beforeEach(function () {
chart.renderLabel(false);
Expand Down

0 comments on commit 3a90e89

Please sign in to comment.