jquery icon indicating copy to clipboard operation
jquery copied to clipboard

Create Unit test for toggle/show/hide( callback )

Open mgol opened this issue 11 years ago • 7 comments

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

mgol avatar Oct 20 '14 23:10 mgol

Rescheduling to 3.0.1.

mgol avatar Sep 14 '15 18:09 mgol

Can I work on the issue?

SaptakS avatar Dec 13 '16 16:12 SaptakS

I am pretty sure no one else is! Feel free!

gnarf avatar Dec 13 '16 17:12 gnarf

@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?

SaptakS avatar Dec 13 '16 17:12 SaptakS

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 avatar Dec 13 '16 17:12 gnarf

@gnarf ok thanks. I will look into it.

SaptakS avatar Dec 13 '16 17:12 SaptakS

Hi @gnarf can I work on this ?

mercyg avatar Jul 28 '23 17:07 mercyg