diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2012-11-03 16:17:16 -0400 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2012-11-03 16:17:16 -0400 |
commit | 3df9ea29e644a3dd6345161513dae5823d9b0460 (patch) | |
tree | 08bdc053f90d110cb4af39c4de464d92ad8142c6 /tests/unit/droppable | |
parent | 68ad80c2922daccba773a9adafe9fb5efcb129a2 (diff) | |
download | jquery-ui-3df9ea29e644a3dd6345161513dae5823d9b0460.tar.gz jquery-ui-3df9ea29e644a3dd6345161513dae5823d9b0460.zip |
Dev: remove globals from tests and moved test helpers to correct location - Fixed #8770 Dev: Remove globals and Standardize Test Suite
Diffstat (limited to 'tests/unit/droppable')
-rw-r--r-- | tests/unit/droppable/droppable.html | 1 | ||||
-rw-r--r-- | tests/unit/droppable/droppable_core.js | 11 | ||||
-rw-r--r-- | tests/unit/droppable/droppable_methods.js | 14 | ||||
-rw-r--r-- | tests/unit/droppable/droppable_options.js | 4 | ||||
-rw-r--r-- | tests/unit/droppable/droppable_test_helpers.js | 10 |
5 files changed, 23 insertions, 17 deletions
diff --git a/tests/unit/droppable/droppable.html b/tests/unit/droppable/droppable.html index cd29b1cdf..7cd5eb0f5 100644 --- a/tests/unit/droppable/droppable.html +++ b/tests/unit/droppable/droppable.html @@ -27,6 +27,7 @@ <script src="droppable_events.js"></script> <script src="droppable_methods.js"></script> <script src="droppable_options.js"></script> + <script src="droppable_test_helpers.js"></script> <script src="../swarminject.js"></script> </head> diff --git a/tests/unit/droppable/droppable_core.js b/tests/unit/droppable/droppable_core.js index 21763bc63..c98850a03 100644 --- a/tests/unit/droppable/droppable_core.js +++ b/tests/unit/droppable/droppable_core.js @@ -2,17 +2,6 @@ * droppable_core.js */ -TestHelpers.droppable = { - shouldDrop: function() { - // todo: actually implement this - ok(true, 'missing test - untested code is broken code'); - }, - shouldNotDrop: function() { - // todo: actually implement this - ok(true, 'missing test - untested code is broken code'); - } -}; - (function($) { module("droppable: core"); diff --git a/tests/unit/droppable/droppable_methods.js b/tests/unit/droppable/droppable_methods.js index 3f1293ae4..76501c5b1 100644 --- a/tests/unit/droppable/droppable_methods.js +++ b/tests/unit/droppable/droppable_methods.js @@ -43,6 +43,9 @@ test("destroy", function() { test("enable", function() { expect(7); + + var el, expected, actual; + el = $("#droppable1").droppable({ disabled: true }); TestHelpers.droppable.shouldNotDrop(); el.droppable("enable"); @@ -55,13 +58,16 @@ test("enable", function() { equal(el.droppable("option", "disabled"), false, "disabled option setter"); TestHelpers.droppable.shouldDrop(); - var expected = $('<div></div>').droppable(), - actual = expected.droppable('enable'); + expected = $('<div></div>').droppable(), + actual = expected.droppable('enable'); equal(actual, expected, 'enable is chainable'); }); test("disable", function() { expect(7); + + var el, actual, expected; + el = $("#droppable1").droppable({ disabled: false }); TestHelpers.droppable.shouldDrop(); el.droppable("disable"); @@ -74,8 +80,8 @@ test("disable", function() { equal(el.droppable("option", "disabled"), true, "disabled option setter"); TestHelpers.droppable.shouldNotDrop(); - var expected = $('<div></div>').droppable(), - actual = expected.droppable('disable'); + expected = $('<div></div>').droppable(), + actual = expected.droppable('disable'); equal(actual, expected, 'disable is chainable'); }); diff --git a/tests/unit/droppable/droppable_options.js b/tests/unit/droppable/droppable_options.js index db3201e88..c2ecdcfda 100644 --- a/tests/unit/droppable/droppable_options.js +++ b/tests/unit/droppable/droppable_options.js @@ -24,14 +24,14 @@ test("activeClass", function() { */ test("{ addClasses: true }, default", function() { expect( 1 ); - el = $("<div></div>").droppable({ addClasses: true }); + var el = $("<div></div>").droppable({ addClasses: true }); ok(el.is(".ui-droppable"), "'ui-droppable' class added"); el.droppable("destroy"); }); test("{ addClasses: false }", function() { expect( 1 ); - el = $("<div></div>").droppable({ addClasses: false }); + var el = $("<div></div>").droppable({ addClasses: false }); ok(!el.is(".ui-droppable"), "'ui-droppable' class not added"); el.droppable("destroy"); }); diff --git a/tests/unit/droppable/droppable_test_helpers.js b/tests/unit/droppable/droppable_test_helpers.js new file mode 100644 index 000000000..79311788c --- /dev/null +++ b/tests/unit/droppable/droppable_test_helpers.js @@ -0,0 +1,10 @@ +TestHelpers.droppable = { + shouldDrop: function() { + // todo: actually implement this + ok(true, 'missing test - untested code is broken code'); + }, + shouldNotDrop: function() { + // todo: actually implement this + ok(true, 'missing test - untested code is broken code'); + } +};
\ No newline at end of file |