Skip to content
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

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

Open
mgol opened this issue Oct 20, 2014 · 6 comments

Comments

@mgol
Copy link
Member

commented Oct 20, 2014

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

@timmywil timmywil added the Effects label Jan 30, 2015
@timmywil timmywil added this to the 3.0.0 milestone Jan 30, 2015
@timmywil timmywil self-assigned this May 5, 2015
@mgol mgol modified the milestones: 3.0.1, 3.0.0 Sep 14, 2015
@mgol

This comment has been minimized.

Copy link
Member Author

commented Sep 14, 2015

Rescheduling to 3.0.1.

@timmywil timmywil modified the milestones: 3.0.1, Future Jun 30, 2016
@SaptakS

This comment has been minimized.

Copy link
Contributor

commented Dec 13, 2016

Can I work on the issue?

@gnarf

This comment has been minimized.

Copy link
Member

commented Dec 13, 2016

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

@SaptakS

This comment has been minimized.

Copy link
Contributor

commented Dec 13, 2016

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

@gnarf

This comment has been minimized.

Copy link
Member

commented Dec 13, 2016

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

@SaptakS

This comment has been minimized.

Copy link
Contributor

commented Dec 13, 2016

@gnarf ok thanks. I will look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.