From 3a90e89fdc23037f3e672345d75e9d6e9ca78b3d Mon Sep 17 00:00:00 2001 From: Gordon Woodhull Date: Thu, 1 Dec 2016 14:40:19 -0500 Subject: [PATCH] negative and positive tests for .xyTipsOn fixes #1152 --- AUTHORS | 1 + spec/line-chart-spec.js | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/AUTHORS b/AUTHORS index 329add2e5..11137f2fa 100644 --- a/AUTHORS +++ b/AUTHORS @@ -83,3 +83,4 @@ Michael Dougherty Paul Mach Fil Mauricio Bustos +Anders Dalvander diff --git a/spec/line-chart-spec.js b/spec/line-chart-spec.js index 50f0c7068..426348e08 100644 --- a/spec/line-chart-spec.js +++ b/spec/line-chart-spec.js @@ -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);