From e1d670dbbff8efa41772677cdcb9e448d78f73c0 Mon Sep 17 00:00:00 2001 From: Arun Philip Date: Mon, 13 May 2024 10:32:56 -0400 Subject: [PATCH] update test to explicitly run clearCanvas method to ensure it doesn't throw an error --- test/specs/helpers.canvas.tests.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/specs/helpers.canvas.tests.js b/test/specs/helpers.canvas.tests.js index 60f1b1f8700..32ed3752ad2 100644 --- a/test/specs/helpers.canvas.tests.js +++ b/test/specs/helpers.canvas.tests.js @@ -23,13 +23,15 @@ describe('Chart.helpers.canvas', function() { }); it('should not throw error when chart is null', function() { - function createChart() { - return acquireChart({}, { + function createAndClearChart() { + var chart = acquireChart({}, { canvas: null }); + + helpers.clearCanvas(chart.canvas, chart.ctx); } - expect(createChart).not.toThrow(); + expect(createAndClearChart).not.toThrow(); }); });