-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace the old style canvas "mock" context checks by image based unit tests which are easier to maintain and allow more flexibility in the drawing logic since we are not testing the context calls but the final painted result.
- Loading branch information
1 parent
9a29581
commit 9160839
Showing
30 changed files
with
1,000 additions
and
470 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,129 @@ | ||
{ | ||
"config": { | ||
"type": "bubble", | ||
"data": { | ||
"datasets": [{ | ||
"data": [ | ||
{"x": 0, "y": 3}, | ||
{"x": 1, "y": 3}, | ||
{"x": 2, "y": 3}, | ||
{"x": 3, "y": 3}, | ||
{"x": 4, "y": 3}, | ||
{"x": 5, "y": 3}, | ||
{"x": 6, "y": 3}, | ||
{"x": 7, "y": 3}, | ||
{"x": 8, "y": 3}, | ||
{"x": 9, "y": 3} | ||
], | ||
"backgroundColor": "#00ff00", | ||
"borderColor": "transparent", | ||
"borderWidth": 0, | ||
"pointStyle": [ | ||
"circle", | ||
"cross", | ||
"crossRot", | ||
"dash", | ||
"line", | ||
"rect", | ||
"rectRounded", | ||
"rectRot", | ||
"star", | ||
"triangle" | ||
] | ||
}, { | ||
"data": [ | ||
{"x": 0, "y": 2}, | ||
{"x": 1, "y": 2}, | ||
{"x": 2, "y": 2}, | ||
{"x": 3, "y": 2}, | ||
{"x": 4, "y": 2}, | ||
{"x": 5, "y": 2}, | ||
{"x": 6, "y": 2}, | ||
{"x": 7, "y": 2}, | ||
{"x": 8, "y": 2}, | ||
{"x": 9, "y": 2} | ||
], | ||
"backgroundColor": "transparent", | ||
"borderColor": "0000ff", | ||
"borderWidth": 0, | ||
"pointStyle": [ | ||
"circle", | ||
"cross", | ||
"crossRot", | ||
"dash", | ||
"line", | ||
"rect", | ||
"rectRounded", | ||
"rectRot", | ||
"star", | ||
"triangle" | ||
] | ||
}, { | ||
"data": [ | ||
{"x": 0, "y": 1}, | ||
{"x": 1, "y": 1}, | ||
{"x": 2, "y": 1}, | ||
{"x": 3, "y": 1}, | ||
{"x": 4, "y": 1}, | ||
{"x": 5, "y": 1}, | ||
{"x": 6, "y": 1}, | ||
{"x": 7, "y": 1}, | ||
{"x": 8, "y": 1}, | ||
{"x": 9, "y": 1} | ||
], | ||
"backgroundColor": "#00ff00", | ||
"borderColor": "#0000ff", | ||
"borderWidth": 0, | ||
"pointStyle": [ | ||
"circle", | ||
"cross", | ||
"crossRot", | ||
"dash", | ||
"line", | ||
"rect", | ||
"rectRounded", | ||
"rectRot", | ||
"star", | ||
"triangle" | ||
] | ||
}] | ||
}, | ||
"options": { | ||
"responsive": false, | ||
"legend": false, | ||
"title": false, | ||
"scales": { | ||
"xAxes": [{"display": false}], | ||
"yAxes": [{ | ||
"display": false, | ||
"ticks": { | ||
"min": 0, | ||
"max": 4 | ||
} | ||
}] | ||
}, | ||
"elements": { | ||
"line": { | ||
"borderColor": "transparent", | ||
"borderWidth": 0, | ||
"fill": false | ||
}, | ||
"point": { | ||
"radius": 16 | ||
} | ||
}, | ||
"layout": { | ||
"padding": { | ||
"left": 24, | ||
"right": 24 | ||
} | ||
} | ||
} | ||
}, | ||
"options": { | ||
"canvas": { | ||
"height": 256, | ||
"width": 512 | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,98 @@ | ||
{ | ||
"config": { | ||
"type": "line", | ||
"data": { | ||
"labels": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], | ||
"datasets": [{ | ||
"borderColor": "transparent", | ||
"data": [3, 3, 3, 3, 3, 3, 3, 3, 3, 3], | ||
"pointBackgroundColor": "#00ff00", | ||
"pointBorderColor": "transparent", | ||
"pointBorderWidth": 0, | ||
"pointStyle": [ | ||
"circle", | ||
"cross", | ||
"crossRot", | ||
"dash", | ||
"line", | ||
"rect", | ||
"rectRounded", | ||
"rectRot", | ||
"star", | ||
"triangle" | ||
] | ||
}, { | ||
"borderColor": "transparent", | ||
"data": [2, 2, 2, 2, 2, 2, 2, 2, 2, 2], | ||
"pointBackgroundColor": "transparent", | ||
"pointBorderColor": "#0000ff", | ||
"pointBorderWidth": 1, | ||
"pointStyle": [ | ||
"circle", | ||
"cross", | ||
"crossRot", | ||
"dash", | ||
"line", | ||
"rect", | ||
"rectRounded", | ||
"rectRot", | ||
"star", | ||
"triangle" | ||
] | ||
}, { | ||
"borderColor": "transparent", | ||
"data": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], | ||
"pointBackgroundColor": "#00ff00", | ||
"pointBorderColor": "#0000ff", | ||
"pointBorderWidth": 1, | ||
"pointStyle": [ | ||
"circle", | ||
"cross", | ||
"crossRot", | ||
"dash", | ||
"line", | ||
"rect", | ||
"rectRounded", | ||
"rectRot", | ||
"star", | ||
"triangle" | ||
] | ||
}] | ||
}, | ||
"options": { | ||
"responsive": false, | ||
"legend": false, | ||
"title": false, | ||
"scales": { | ||
"xAxes": [{"display": false}], | ||
"yAxes": [{ | ||
"display": false, | ||
"ticks": { | ||
"min": 0, | ||
"max": 4 | ||
} | ||
}] | ||
}, | ||
"elements": { | ||
"line": { | ||
"fill": false | ||
}, | ||
"point": { | ||
"radius": 16 | ||
} | ||
}, | ||
"layout": { | ||
"padding": { | ||
"left": 24, | ||
"right": 24 | ||
} | ||
} | ||
} | ||
}, | ||
"options": { | ||
"canvas": { | ||
"height": 256, | ||
"width": 512 | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,95 @@ | ||
{ | ||
"config": { | ||
"type": "radar", | ||
"data": { | ||
"labels": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], | ||
"datasets": [{ | ||
"borderColor": "transparent", | ||
"data": [3, 3, 3, 3, 3, 3, 3, 3, 3, 3], | ||
"pointBackgroundColor": "#00ff00", | ||
"pointBorderColor": "transparent", | ||
"pointBorderWidth": 0, | ||
"pointRadius": 16, | ||
"pointStyle": [ | ||
"circle", | ||
"cross", | ||
"crossRot", | ||
"dash", | ||
"line", | ||
"rect", | ||
"rectRounded", | ||
"rectRot", | ||
"star", | ||
"triangle" | ||
] | ||
}, { | ||
"borderColor": "transparent", | ||
"data": [2, 2, 2, 2, 2, 2, 2, 2, 2, 2], | ||
"pointBackgroundColor": "transparent", | ||
"pointBorderColor": "#0000ff", | ||
"pointBorderWidth": 1, | ||
"pointRadius": 16, | ||
"pointStyle": [ | ||
"circle", | ||
"cross", | ||
"crossRot", | ||
"dash", | ||
"line", | ||
"rect", | ||
"rectRounded", | ||
"rectRot", | ||
"star", | ||
"triangle" | ||
] | ||
}, { | ||
"borderColor": "transparent", | ||
"data": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], | ||
"pointBackgroundColor": "#00ff00", | ||
"pointBorderColor": "#0000ff", | ||
"pointBorderWidth": 1, | ||
"pointRadius": 16, | ||
"pointStyle": [ | ||
"circle", | ||
"cross", | ||
"crossRot", | ||
"dash", | ||
"line", | ||
"rect", | ||
"rectRounded", | ||
"rectRot", | ||
"star", | ||
"triangle" | ||
] | ||
}] | ||
}, | ||
"options": { | ||
"responsive": false, | ||
"legend": false, | ||
"title": false, | ||
"scale": { | ||
"display": false, | ||
"ticks": { | ||
"min": 0, | ||
"max": 3 | ||
} | ||
}, | ||
"elements": { | ||
"line": { | ||
"fill": false | ||
} | ||
}, | ||
"layout": { | ||
"padding": { | ||
"left": 24, | ||
"right": 24 | ||
} | ||
} | ||
} | ||
}, | ||
"options": { | ||
"canvas": { | ||
"height": 512, | ||
"width": 512 | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,67 @@ | ||
{ | ||
"config": { | ||
"type": "bubble", | ||
"data": { | ||
"datasets": [{ | ||
"data": [ | ||
{"x": 0, "y": 3, "r": 0}, | ||
{"x": 1, "y": 3, "r": 2}, | ||
{"x": 2, "y": 3, "r": 4}, | ||
{"x": 3, "y": 3, "r": 8}, | ||
{"x": 4, "y": 3, "r": 16}, | ||
{"x": 5, "y": 3, "r": 32} | ||
], | ||
"backgroundColor": "#00ff00", | ||
"borderColor": "transparent", | ||
"borderWidth": 0 | ||
}, { | ||
"data": [ | ||
{"x": 0, "y": 2, "r": 0}, | ||
{"x": 1, "y": 2, "r": 2}, | ||
{"x": 2, "y": 2, "r": 4}, | ||
{"x": 3, "y": 2, "r": 8}, | ||
{"x": 4, "y": 2, "r": 16}, | ||
{"x": 5, "y": 2, "r": 32} | ||
], | ||
"backgroundColor": "transparent", | ||
"borderColor": "#0000ff", | ||
"borderWidth": 1 | ||
}, { | ||
"data": [ | ||
{"x": 0, "y": 1, "r": 0}, | ||
{"x": 1, "y": 1, "r": 2}, | ||
{"x": 2, "y": 1, "r": 4}, | ||
{"x": 3, "y": 1, "r": 8}, | ||
{"x": 4, "y": 1, "r": 16}, | ||
{"x": 5, "y": 1, "r": 32} | ||
], | ||
"backgroundColor": "#00ff00", | ||
"borderColor": "#0000ff", | ||
"borderWidth": 2 | ||
}] | ||
}, | ||
"options": { | ||
"responsive": false, | ||
"legend": false, | ||
"title": false, | ||
"elements": { | ||
"point": { | ||
"pointStyle": "circle" | ||
} | ||
}, | ||
"layout": { | ||
"padding": 40 | ||
}, | ||
"scales": { | ||
"xAxes": [{"display": false}], | ||
"yAxes": [{"display": false}] | ||
} | ||
} | ||
}, | ||
"options": { | ||
"canvas": { | ||
"height": 256, | ||
"width": 512 | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
9160839
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how can we debug when one of those tests failed?
9160839
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gulp unittest --watch
9160839
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est bon. Merci