aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/slider
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2010-08-27 14:48:17 -0400
committerScott González <scott.gonzalez@gmail.com>2010-08-27 14:48:17 -0400
commit1e28040cf358d0fe81ee83a2e35d7dbb65362afa (patch)
tree721a02ecfcfb52284e0d55a79ff303a5c98c4787 /tests/unit/slider
parent52a052be79d21aa519ccb513dc00a7c54868ef03 (diff)
downloadjquery-ui-1e28040cf358d0fe81ee83a2e35d7dbb65362afa.tar.gz
jquery-ui-1e28040cf358d0fe81ee83a2e35d7dbb65362afa.zip
Widget: Throw errors when calling non-existent methods or methods on uninistantiated widgets. Fixes #5972 - Widget: Throw error for non-existent method calls.
Diffstat (limited to 'tests/unit/slider')
-rw-r--r--tests/unit/slider/slider.html1
-rw-r--r--tests/unit/slider/slider_methods.js8
2 files changed, 2 insertions, 7 deletions
diff --git a/tests/unit/slider/slider.html b/tests/unit/slider/slider.html
index 1ba5f76af..765340eb5 100644
--- a/tests/unit/slider/slider.html
+++ b/tests/unit/slider/slider.html
@@ -15,6 +15,7 @@
<link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>
<script type="text/javascript" src="../../../external/qunit.js"></script>
<script type="text/javascript" src="../../jquery.simulate.js"></script>
+ <script type="text/javascript" src="../testsuite.js"></script>
<script type="text/javascript" src="slider_core.js"></script>
<script type="text/javascript" src="slider_defaults.js"></script>
diff --git a/tests/unit/slider/slider_methods.js b/tests/unit/slider/slider_methods.js
index 567c5de2e..77ae65148 100644
--- a/tests/unit/slider/slider_methods.js
+++ b/tests/unit/slider/slider_methods.js
@@ -6,7 +6,7 @@
module("slider: methods");
test("init", function() {
- expect(6);
+ expect(5);
$("<div></div>").appendTo('body').slider().remove();
ok(true, '.slider() called on element');
@@ -17,9 +17,6 @@ test("init", function() {
$('<div></div>').slider().remove();
ok(true, '.slider() called on disconnected DOMElement');
- $('<div></div>').slider().slider("foo").remove();
- ok(true, 'arbitrary method called after init');
-
var el = $('<div></div>').slider();
var foo = el.slider("option", "foo");
el.remove();
@@ -39,9 +36,6 @@ test("destroy", function() {
$('<div></div>').appendTo('body').remove().slider().slider("destroy").remove();
ok(true, '.slider("destroy") called on disconnected DOMElement');
- $('<div></div>').slider().slider("destroy").slider("foo").remove();
- ok(true, 'arbitrary method called after destroy');
-
var expected = $('<div></div>').slider(),
actual = expected.slider('destroy');
equals(actual, expected, 'destroy is chainable');