aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/widget
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2013-05-20 11:30:49 -0400
committerScott González <scott.gonzalez@gmail.com>2013-05-20 11:30:49 -0400
commit2eb89f07341a557084fa3363fe22afe62530654d (patch)
treea6bc0b09a6c98d026d53a84f86203d77b72b0349 /tests/unit/widget
parent9726cd72b64e9e9735cfdb5564ebef64a6dab0aa (diff)
downloadjquery-ui-2eb89f07341a557084fa3363fe22afe62530654d.tar.gz
jquery-ui-2eb89f07341a557084fa3363fe22afe62530654d.zip
Widget: Properly set widgetEventPrefix when redefining a widget. Fixes #9316 - Widget: widgetEventPrefix is empty when widget is (occasionally) loaded twice.
Diffstat (limited to 'tests/unit/widget')
-rw-r--r--tests/unit/widget/widget_core.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unit/widget/widget_core.js b/tests/unit/widget/widget_core.js
index 0d97742ff..3268b756d 100644
--- a/tests/unit/widget/widget_core.js
+++ b/tests/unit/widget/widget_core.js
@@ -331,6 +331,16 @@ test( "re-init", function() {
deepEqual( actions, [ "optionfoo", "init" ], "correct methods called on re-init with options" );
});
+test( "redeclare", function() {
+ expect( 2 );
+
+ $.widget( "ui.testWidget", {} );
+ equal( $.ui.testWidget.prototype.widgetEventPrefix, "testWidget" );
+
+ $.widget( "ui.testWidget", {} );
+ equal( $.ui.testWidget.prototype.widgetEventPrefix, "testWidget" );
+});
+
test( "inheritance", function() {
expect( 6 );
// #5830 - Widget: Using inheritance overwrites the base classes options