aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-11-09 16:48:52 -0500
committerScott González <scott.gonzalez@gmail.com>2012-11-09 16:49:03 -0500
commit9e858ba14ac0ae26780581a34565e84e0ae108ef (patch)
tree5f18296ebc8071367c3e4c6ea83e0b709cac75b3 /tests
parent254f2b3698265bdcb7daa85f8c7e2c27192cd090 (diff)
downloadjquery-ui-9e858ba14ac0ae26780581a34565e84e0ae108ef.tar.gz
jquery-ui-9e858ba14ac0ae26780581a34565e84e0ae108ef.zip
Widget: Only use the event prefix from the base if we're redefining a widget. Fixes #8805 - Widget: widgetEventPrefix is incorrect when inheriting with jQuery UI 1.9.1.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/widget/widget_core.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/unit/widget/widget_core.js b/tests/unit/widget/widget_core.js
index 418cc4d39..18b93d92e 100644
--- a/tests/unit/widget/widget_core.js
+++ b/tests/unit/widget/widget_core.js
@@ -326,8 +326,8 @@ test( "re-init", function() {
deepEqual( actions, [ "optionfoo", "init" ], "correct methods called on re-init with options" );
});
-test( "inheritance - options", function() {
- expect( 4 );
+test( "inheritance", function() {
+ expect( 6 );
// #5830 - Widget: Using inheritance overwrites the base classes options
$.widget( "ui.testWidgetBase", {
options: {
@@ -348,6 +348,8 @@ test( "inheritance - options", function() {
}
});
+ equal( $.ui.testWidgetBase.prototype.widgetEventPrefix, "testWidgetBase",
+ "base class event prefix" );
deepEqual( $.ui.testWidgetBase.prototype.options.obj, {
key1: "foo",
key2: "bar"
@@ -355,6 +357,8 @@ test( "inheritance - options", function() {
deepEqual( $.ui.testWidgetBase.prototype.options.arr, [ "testing" ],
"base class option array not overridden");
+ equal( $.ui.testWidgetExtension.prototype.widgetEventPrefix, "testWidgetExtension",
+ "extension class event prefix" );
deepEqual( $.ui.testWidgetExtension.prototype.options.obj, {
key1: "baz",
key2: "bar"