Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests related to showLines for controller.scatter (#5150)
- Loading branch information
1 parent
e585c75
commit 6d58a6a
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
}); | ||
}); | ||
}); |