Create Unit test for toggle/show/hide( callback )
Originally reported by gnarf at: http://bugs.jquery.com/ticket/12821
This signature should result in an animated toggle/show/hide with the default duration. This has historically been the behavior, and we should test it and document it. See also https://github.com/jquery/api.jquery.com/issues/167.
The signature should also hold true for fade* and slide*
Issue reported for jQuery 1.8.2
Rescheduling to 3.0.1.
Can I work on the issue?
I am pretty sure no one else is! Feel free!
@gnarf can you help me a little about what needs to be done? I can see that here it was reported that callback also results in animation. So should I be adding that in the documentation and creating unit tests for that check?
The documentation does exist for it, because duration is optional in the signature, but it should be unit tested that when you call .toggle(fn) .show(fn) or .hide(fn) it results in a default duration animation.
Something along the lines of calling jQuery( ".some-hidden-element" ).toggle( function( p ) { callbackCalled = true; } ) then checking that callbackCalled isn't called, perhaps checking the state of the element is correct for a show/hide animation in it's first frame, then this.clock.tick(400) and check that callbackCalled and last frame.
This should probably be sufficient
@gnarf ok thanks. I will look into it.
Hi @gnarf can I work on this ?