-
Notifications
You must be signed in to change notification settings - Fork 20.5k
Effects: finish should call progress #2292
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
|
Thanks! We will need some unit tests for this change to ensure that it actually works. The closest existing test we have is here but you can probably create a simpler one just to check for |
src/effects.js
Outdated
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.
Missing space between ] and ).
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.
Oops, it's okay.
|
I was on the fence about changing when we notify animations, but this makes sense. 👍 |
|
Agreed 👍 Thanks @mr21! |
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 change something here, because in jQuery if there is no property to animate (here it's empty with the {}) .stop( true ) is called. So, progress is now called twice.
|
👍 |
test/unit/effects.js
Outdated
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.
Just prog = 1, please. There's no need to be overly clever in known environments like unit tests.
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.
Yeah right (done).
test/unit/effects.js
Outdated
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.
why aren't we using a camel cased variable name here, as always?
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.
It's because I'm used to add jq_ for every jQuery object, but I removed the variable anyway, thanks.
|
@gibson042, I've used qunit-assert-step (like you said) to test if the callbacks are called in order. It works fine :) |
|
Yep; looks like the plugin was added correctly. 👍 |
test/unit/effects.js
Outdated
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.
This assertion adds no value.
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.
Yeah right, I removed this
Actually, it wasn't. ;) You shouldn't copy files to |
test/unit/effects.js
Outdated
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.
These equals should be strictEquals, and the messages ought to be more clear (e.g., "(first|last) progress callback: (progress ratio|remaining ms)").
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 renamed these 4 tests, thanks
|
@mzgol, okay thanks, I modified the |
Conflicts: package.json
|
No more conflict here |
|
Landed, thanks! |
A pull request for #2283.