Add tests related to showLines for controller.scatter#5150
Add tests related to showLines for controller.scatter#5150simonbrunel merged 6 commits intochartjs:masterfrom
Conversation
| @@ -0,0 +1,115 @@ | |||
| describe('Chart.controllers.scatter', function() { | |||
|
|
|||
| it('should not draw a line if the options showLines is not set', function() { | |||
There was a problem hiding this comment.
Can you nest all these tests under showLines option:
describe('Chart.controllers.scatter', function() {
describe('showLines option', function() {
it('should not draw a line if undefined', function() {
// ...
it('should not draw a line if false', function() {
// ...
it('should draw a line if true', function() {
// ...| type: 'scatter', | ||
| data: { | ||
| datasets: [{ | ||
| data: [ |
There was a problem hiding this comment.
We don't need so much data, maybe one is enough data: [{x: 10, y: 15}] since we are not verifying how the line is drawing but only if the method is called. That would make all tests shorter.
|
To be consistent, we should add the same tests for the line controller, or better we could move these tests in |
|
|
|
That would make maintaining those tests more complicated because the code is currently exactly the same, only defaults are different. If we update the behavior of the line controller, we would need to update tests in both files. I would only implement tests that differs from the line controller. If the behavior is changed in scatter as you did in your other PR, then we will add (duplicate?) tests associated to that behavior. I would simply make sure that |
As discussed in #5134, a PR to add tests for scatter charts.
It tests for 3 values of showLines : default value, true, false.