From: Loïc Bourgois Date: Tue, 16 Jan 2018 09:29:49 +0000 (+0000) Subject: Add tests related to showLines for controller.scatter (#5150) X-Git-Tag: v2.7.2~1^2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6d58a6a8a8af64373605c86fe380a61250411e17;p=thirdparty%2FChart.js.git Add tests related to showLines for controller.scatter (#5150) --- diff --git a/test/specs/controller.scatter.test.js b/test/specs/controller.scatter.test.js new file mode 100644 index 000000000..435750928 --- /dev/null +++ b/test/specs/controller.scatter.test.js @@ -0,0 +1,25 @@ +describe('Chart.controllers.scatter', function() { + describe('showLines option', function() { + it('should not draw a line if undefined', function() { + var chart = window.acquireChart({ + type: 'scatter', + data: { + datasets: [{ + data: [{x: 10, y: 15}], + label: 'dataset1' + }], + }, + options: {} + }); + + var meta = chart.getDatasetMeta(0); + spyOn(meta.dataset, 'draw'); + spyOn(meta.data[0], 'draw'); + + chart.update(); + + expect(meta.dataset.draw.calls.count()).toBe(0); + expect(meta.data[0].draw.calls.count()).toBe(1); + }); + }); +});