-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Add tests related to showLines for controller.scatter #5150
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.