-
Notifications
You must be signed in to change notification settings - Fork 107
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
Fix Indeterminate State not Triggered from 'false' state #121
Conversation
Replaced default checkbox formatter to ignore comparing 'undefined' value.
Awesome! Can you please add a test for the false-to-indeterminate switch? Try to cover all edge cases if possible. Thanks! |
Done. I am not familiar with writing test case with karma (in fact it's the first time I've written one) Btw, I didn't realize indeterminate includes null value as well. Added it. |
scope.$apply(); | ||
expect(element.hasClass(CONST.SWITCH_INDETERMINATE_CLASS)).toBeTruthy(); | ||
expect(element.hasClass(CONST.SWITCH_OFF_CLASS)).toBeFalsy(); | ||
expect(element.hasClass(CONST.SWITCH_ON_CLASS)).toBeTruthy(); |
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.
If it is indeterminate, how come the on class is set?
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 thought that's how your library behaves?
All your test codes were written that way.
Hi guys, Any idea when this will be merged? |
Since you ( @frapontillo ) validated, all checks have passed and branch has no conflicts, could you please merge to base? I would prefer using "official" patched version than modifiying code file myself like a savage. |
@ygilliot I'm still not convinced by #121 (comment) |
@vincent-leonardo can I have an update on this? |
@frapontillo as I mentioned before, your test cases were written such that in |
Thanks @vincent-leonardo! |
@frapontillo no problem, glad it helps. |
#76
Hi, after tracing the calls of indeterminate toggling I've found the source of this minor bug.
The problems happens with the default checkbox $formatters by angular.
The default checkbox formatters[0] on angular.js:24100
So I did a quick hack to replace the default formatters in initMaybe @ bsSwitch.js
bsSwitch.js:153