Draggable: Added tests for opacity and zIndex

This commit is contained in:
Dave Stein 2013-01-15 19:32:06 -05:00
parent f616b62a5d
commit 5f26d83c78

View File

@ -942,6 +942,30 @@ test("{ opacity: 0.5 }", function() {
}); });
test("opacity, default, switching after initialization", function() {
expect(3);
var opacity = null,
el = $("#draggable2").draggable({
start: function() {
opacity = $(this).css("opacity");
}
});
TestHelpers.draggable.move( el, 1, 1 );
equal( opacity, 1 );
el.draggable( "option", "opacity", 0.5 );
TestHelpers.draggable.move( el, 2, 1 );
equal( opacity, 0.5 );
el.draggable( "option", "opacity", false );
TestHelpers.draggable.move( el, 3, 1 );
equal( opacity, 1 );
});
test("{ zIndex: 10 }", function() { test("{ zIndex: 10 }", function() {
expect(1); expect(1);
@ -964,4 +988,30 @@ test("{ zIndex: 10 }", function() {
}); });
test("zIndex, default, switching after initialization", function() {
expect(3);
var zindex = null,
el = $("#draggable2").draggable({
start: function() {
zindex = $(this).css("z-index");
}
});
el.css( "z-index", 1 );
TestHelpers.draggable.move( el, 1, 1 );
equal( zindex, 1 );
el.draggable( "option", "zIndex", 5 );
TestHelpers.draggable.move( el, 2, 1 );
equal( zindex, 5 );
el.draggable( "option", "zIndex", false );
TestHelpers.draggable.move( el, 3, 1 );
equal( zindex, 1 );
});
})(jQuery); })(jQuery);