aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/widget
diff options
context:
space:
mode:
authorjzaefferer <joern.zaefferer@gmail.com>2010-07-30 14:26:58 +0200
committerjzaefferer <joern.zaefferer@gmail.com>2010-07-30 14:26:58 +0200
commitea58cd5ac0d852a9c7d7ceadbcbb74006cf9052d (patch)
tree35cff2c8f0505cf9b5430b33df0ff7ab5c85dc59 /tests/unit/widget
parentb3940d2f78dfcc37792ceb97e5659b78f156794c (diff)
downloadjquery-ui-ea58cd5ac0d852a9c7d7ceadbcbb74006cf9052d.tar.gz
jquery-ui-ea58cd5ac0d852a9c7d7ceadbcbb74006cf9052d.zip
Use pushStack in widget method. Fixes #5732 - make the widget method maintain the stack
Diffstat (limited to 'tests/unit/widget')
-rw-r--r--tests/unit/widget/widget_core.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/unit/widget/widget_core.js b/tests/unit/widget/widget_core.js
index 3c870f1fe..52c91d51e 100644
--- a/tests/unit/widget/widget_core.js
+++ b/tests/unit/widget/widget_core.js
@@ -151,7 +151,8 @@ test(".widget() - base", function() {
_create: function() {}
});
var div = $("<div></div>").testWidget()
- same(div[0], div.testWidget("widget")[0]);
+ same(div.testWidget("widget")[0], div[0]);
+ same(div.testWidget("widget").end()[0], div[0]);
});
test(".widget() - overriden", function() {
@@ -159,10 +160,12 @@ test(".widget() - overriden", function() {
$.widget("ui.testWidget", {
_create: function() {},
widget: function() {
- return wrapper;
+ return this.element.pushStack(wrapper.get());
}
});
- same(wrapper[0], $("<div></div>").testWidget().testWidget("widget")[0]);
+ var div = $("<div></div>").testWidget();
+ same(div.testWidget("widget")[0], wrapper[0]);
+ same(div.testWidget("widget").end()[0], div[0]);
});
})(jQuery);