Last active
August 29, 2015 14:04
-
-
Save kyeh/cf247946dae4367d8c4f to your computer and use it in GitHub Desktop.
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("In-progress message visible once Deferred is resolved", function(){ | |
var deferred = $.Deferred(); | |
this.mock($.prototype).expects('hide') | |
.withArgs(2000) | |
.once() | |
.returns(deferred); | |
hideLink(); | |
// using our deferred will keep the status from updating | |
QUnit.equal($('#hide-status').text(), 'Link hiding in-progress'); | |
}); | |
test("Finished message visible once Deferred is resolved", function(){ | |
// ... mocking deferred object after hide() call | |
hideLink(); | |
// resolving our deferred will trigger finished message | |
deferred.resolve(); | |
QUnit.equal($('#hide-status').text(), 'Link hiding finished' ); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment