Finish specs for AspectEdit#stopDrag.

This commit is contained in:
Sarah Mei 2010-11-10 10:54:12 -07:00
parent 72bf683c87
commit c113ee2b7c

View file

@ -62,6 +62,7 @@ describe("AspectEdit", function() {
spyOn($.fn, "animate"); spyOn($.fn, "animate");
AspectEdit.animateImage($('.avatar')); AspectEdit.animateImage($('.avatar'));
expect($.fn.animate).toHaveBeenCalledWith({'height':80, 'width':80, 'opacity':0.8}, 200); expect($.fn.animate).toHaveBeenCalledWith({'height':80, 'width':80, 'opacity':0.8}, 200);
expect($.fn.animate.mostRecentCall.object).toHaveClass("avatar");
}); });
}); });
@ -75,11 +76,12 @@ describe("AspectEdit", function() {
}); });
describe("stopDrag", function() { describe("stopDrag", function() {
xit("animates the image back to smaller size and full opacity", function() { it("animates the image back to smaller size and full opacity", function() {
spyOn($.fn, "animate"); spyOn($.fn, "animate");
$.proxy(AspectEdit.stopDrag, $('.person.ui-draggable'))(); $.proxy(AspectEdit.stopDrag, $('.person.ui-draggable'))();
expect($.fn.animate).toHaveBeenCalledWith({'height':70, 'width':70, 'opacity':1}, 200); expect($.fn.animate).toHaveBeenCalledWith({'height':70, 'width':70, 'opacity':1}, 200);
expect($.fn.animate.mostRecentCall.object).toHaveClass("avatar"); // fadeOut calls animate, apparently, so mostRecentCall isn't the right call
expect($.fn.animate.calls[0].object).toHaveClass("avatar");
}); });
it("fades out the drag and drop text", function() { it("fades out the drag and drop text", function() {
spyOn($.fn, "fadeOut"); spyOn($.fn, "fadeOut");