Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated controller.scatter.test.js to test default tooltip callbacks #5967

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 22 additions & 0 deletions test/specs/controller.scatter.test.js
Expand Up @@ -3,6 +3,28 @@ describe('Chart.controllers.scatter', function() {
expect(typeof Chart.controllers.scatter).toBe('function');
});

it('should test default tooltip callbacks', function() {
var chart = window.acquireChart({
type: 'scatter',
data: {
datasets: [{
data: [{
x: 10,
y: 15
}],
label: 'dataset1'
}],
},
options: {}
});
var point = chart.getDatasetMeta(0).data[0];
jasmine.triggerMouseEvent(chart, 'mousemove', point);

// Title should be empty
etimberg marked this conversation as resolved.
Show resolved Hide resolved
expect(chart.tooltip._view.title.length).toBe(0);
expect(chart.tooltip._view.body[0].lines).toEqual(['(10, 15)']);
});

describe('showLines option', function() {
it('should not draw a line if undefined', function() {
var chart = window.acquireChart({
Expand Down