Last active
August 29, 2015 14:04
-
-
Save kyeh/3cc0c4c8a736875f35b0 to your computer and use it in GitHub Desktop.
test_hide_doubleclick.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test("Hide called only once if triggered multiple times", function(){ | |
var deferred = $.Deferred(); | |
this.mock($.prototype).expects('hide') | |
.withArgs(2000) | |
.once() // this once assertion will verify hide was called only once during the test | |
.returns(deferred); | |
hideLink(); | |
QUnit.equal($('#hide-status').text(), 'Link hiding in-progress'); | |
hideLink(); //runs the second time after .hide() was called | |
deferred.resolve(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment