mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Draggable Tests: Minor style fixes and removing unnecessary setup and teardown for core tests.
This commit is contained in:
parent
e9faec96ed
commit
38f93c4ac1
@ -4,18 +4,7 @@
|
|||||||
|
|
||||||
(function( $ ) {
|
(function( $ ) {
|
||||||
|
|
||||||
var relativeElement, absoluteElement;
|
module( "draggable: core" );
|
||||||
|
|
||||||
module( "draggable: core", {
|
|
||||||
setup: function() {
|
|
||||||
relativeElement = $("<div style='width: 200px; height: 100px;'>Relative</div>").appendTo("#qunit-fixture");
|
|
||||||
absoluteElement = $("<div style='background: green; width: 200px; height: 100px; position: absolute; top: 10px; left: 10px;'><span>Absolute</span></div>").appendTo("#qunit-fixture");
|
|
||||||
},
|
|
||||||
teardown: function() {
|
|
||||||
relativeElement.remove();
|
|
||||||
absoluteElement.remove();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
test( "element types", function() {
|
test( "element types", function() {
|
||||||
var typeNames = (
|
var typeNames = (
|
||||||
@ -55,18 +44,18 @@ test( "element types", function() {
|
|||||||
|
|
||||||
test( "No options, relative", function() {
|
test( "No options, relative", function() {
|
||||||
expect( 1 );
|
expect( 1 );
|
||||||
TestHelpers.draggable.shouldMove( relativeElement.draggable() );
|
TestHelpers.draggable.shouldMove( $( "#draggable1" ).draggable() );
|
||||||
});
|
});
|
||||||
|
|
||||||
test( "No options, absolute", function() {
|
test( "No options, absolute", function() {
|
||||||
expect( 1 );
|
expect( 1 );
|
||||||
TestHelpers.draggable.shouldMove( absoluteElement.draggable() );
|
TestHelpers.draggable.shouldMove( $( "#draggable2" ).draggable() );
|
||||||
});
|
});
|
||||||
|
|
||||||
test( "resizable handle with complex markup (#8756 / #8757)", function() {
|
test( "resizable handle with complex markup (#8756 / #8757)", function() {
|
||||||
expect( 2 );
|
expect( 2 );
|
||||||
|
|
||||||
relativeElement
|
$( "#draggable1" )
|
||||||
.append(
|
.append(
|
||||||
$("<div>")
|
$("<div>")
|
||||||
.addClass("ui-resizable-handle ui-resizable-w")
|
.addClass("ui-resizable-handle ui-resizable-w")
|
||||||
@ -74,7 +63,7 @@ test( "resizable handle with complex markup (#8756 / #8757)", function() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
var handle = $(".ui-resizable-w div"),
|
var handle = $(".ui-resizable-w div"),
|
||||||
target = relativeElement.draggable().resizable({ handles: "all" });
|
target = $( "#draggable1" ).draggable().resizable({ handles: "all" });
|
||||||
|
|
||||||
// todo: fix resizable so it doesn't require a mouseover
|
// todo: fix resizable so it doesn't require a mouseover
|
||||||
handle.simulate("mouseover").simulate( "drag", { dx: -50 } );
|
handle.simulate("mouseover").simulate( "drag", { dx: -50 } );
|
||||||
|
@ -1056,11 +1056,11 @@ test( "scope", function() {
|
|||||||
|
|
||||||
$( "#droppable" ).droppable({ scope: "tasks" });
|
$( "#droppable" ).droppable({ scope: "tasks" });
|
||||||
|
|
||||||
TestHelpers.draggable.testDrag( element, element, 100, 100, 0, 0, "revert: valid reverts when dropped on a droppable" );
|
TestHelpers.draggable.testDrag( element, element, 100, 100, 0, 0, "revert: valid reverts when dropped on a droppable in scope" );
|
||||||
|
|
||||||
$( "#droppable" ).droppable( "destroy" ).droppable({ scope: "nottasks" });
|
$( "#droppable" ).droppable( "destroy" ).droppable({ scope: "nottasks" });
|
||||||
|
|
||||||
TestHelpers.draggable.testDrag( element, element, 100, 100, 100, 100, "revert: valid reverts when dropped on a droppable" );
|
TestHelpers.draggable.testDrag( element, element, 100, 100, 100, 100, "revert: valid reverts when dropped on a droppable out of scope" );
|
||||||
});
|
});
|
||||||
|
|
||||||
test( "scroll, scrollSensitivity, and scrollSpeed", function() {
|
test( "scroll, scrollSensitivity, and scrollSpeed", function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user