-
Notifications
You must be signed in to change notification settings - Fork 12k
Improve controller test stability #4698
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
Conversation
|
That's right that the doughnut and polar expectations looks weird ( While working on the options: {
plugins: {
legend: false,
title: false
}
} |
|
Yeah, the 0 size looks wrong :/ |
Did just a quick test now (and thanks for the |
|
@simonbrunel should be complete now. |
etimberg
left a comment
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.
I'm guessing the error with the doughnut and polar area charts is due to
Chart.js/src/helpers/helpers.core.js
Line 189 in 4c763bf
| target[key] = helpers.clone(sval); |
f210b12 to
9f1e374
Compare
|
@etimberg good catch, not sure if it's fixable to allow user to do The last failure was caused by the merge in It's not possible to fully change the this._defaults = jasmine.overrideDefaults({
global: {
plugins: {
legend: false,
title: false
}
}
});
/*
this._defaults === {
global: {
plugins: {
legend: undefined,
title: undefined
}
}
}
*/Manipulating defaults in unit tests is not safe since it impacts all specs. If you prefer to not touch the defaults, then we will need to inject that options for every |
|
You've lost me in the discussion but thanks ok since you can perform the additional updates as desired. |
|
I finally think it's better to not rely on defaults to globally disable plugins / hide scales but instead inject these options while acquiring charts. Altering global defaults is not safe and is error prone since we don't really know what are the current options for every tests. I'm going to update the PR with these changes. |
2e641e6 to
b7af0f1
Compare
|
I‘m not sure. May of the tests af simply changed order of chart specs now. Axes are often no longer hidden. Although that might not be required it would make the tests easier to update on future changes? |
|
I didn't understand your first sentence: I simply removed the |
|
I meant these occasions https://github.com/chartjs/Chart.js/pull/4698/files#diff-b4730e5a7a6104600b439e9b30fc34afR826 and following. It may be better going back to the first commit, cleaning these out and force-push? |
|
I changed it to keep the order consistent between all tests. Not sure what the issue with changing the properties order, but up to you if you want to revert it, I will not have time to iterate more on this PR. |
|
No, fine with me. Just thought you might want to keep the changes minimal and didn‘t notice since th initial change resulted from my commit. No problem with cutting the losses on this one :) |
Follow-up to #4694 (comment)
@simonbrunel your suggestion seems to work- no regression with the bar tests. Please have a careful look at doughnut and polar tests- I'm not sure, not having experience with those charts, that the value changes are plausible.