From 6d58a6a8a8af64373605c86fe380a61250411e17 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lo=C3=AFc=20Bourgois?= Date: Tue, 16 Jan 2018 09:29:49 +0000 Subject: [PATCH] Add tests related to showLines for controller.scatter (#5150) --- test/specs/controller.scatter.test.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/specs/controller.scatter.test.js 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); + }); + }); +}); -- 2.47.3