Skip to content

Commit

Permalink
update test to explicitly run clearCanvas method to ensure it doesn't…
Browse files Browse the repository at this point in the history
… throw an error
  • Loading branch information
DAcodedBEAT committed May 13, 2024
1 parent 80df1f8 commit e1d670d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/specs/helpers.canvas.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});

Expand Down

0 comments on commit e1d670d

Please sign in to comment.