aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorAlexander Schmitz <arschmitz@gmail.com>2015-05-13 22:02:32 -0400
committerAlexander Schmitz <arschmitz@gmail.com>2015-05-20 14:27:57 -0400
commite543253468398ab0c3f3603d9523a4673f1491ea (patch)
tree8c93efcf3ee36e62186ec1bc43acf3ee99973c60 /tests/unit
parent24f1ce9ea046607ae9d0611aefbe5bbd636f8d32 (diff)
downloadjquery-ui-e543253468398ab0c3f3603d9523a4673f1491ea.tar.gz
jquery-ui-e543253468398ab0c3f3603d9523a4673f1491ea.zip
Widget: Remove core event/alias and deprecated module dependencies
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/widget/core.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/unit/widget/core.js b/tests/unit/widget/core.js
index c1fb44f3c..235bc6bb6 100644
--- a/tests/unit/widget/core.js
+++ b/tests/unit/widget/core.js
@@ -131,7 +131,7 @@ test( "jQuery usage", function() {
shouldCreate = true;
elem = $( "<div>" )
- .bind( "testwidgetcreate", function() {
+ .on( "testwidgetcreate", function() {
ok( shouldCreate, "create event triggered on instantiation" );
})
.testWidget();
@@ -902,7 +902,7 @@ test( "_on() with delegate", function() {
_create: function() {
var uuid = this.uuid;
this.element = {
- bind: function( event, handler ) {
+ on: function( event, handler ) {
equal( event, "click.testWidget" + uuid );
ok( $.isFunction(handler) );
},
@@ -910,7 +910,7 @@ test( "_on() with delegate", function() {
};
this.widget = function() {
return {
- delegate: function( selector, event, handler ) {
+ on: function( event, selector, handler ) {
equal( selector, "a" );
equal( event, "click.testWidget" + uuid );
ok( $.isFunction(handler) );
@@ -923,7 +923,7 @@ test( "_on() with delegate", function() {
});
this.widget = function() {
return {
- delegate: function( selector, event, handler ) {
+ on: function( event, selector, handler ) {
equal( selector, "form fieldset > input" );
equal( event, "change.testWidget" + uuid );
ok( $.isFunction(handler) );
@@ -1005,7 +1005,7 @@ test( "_off() - single event", function() {
widget._on( element, { foo: function() {
ok( shouldTriggerWidget, "foo called from _on" );
}});
- element.bind( "foo", function() {
+ element.on( "foo", function() {
ok( shouldTriggerOther, "foo called from bind" );
});
shouldTriggerWidget = true;
@@ -1031,7 +1031,7 @@ test( "_off() - multiple events", function() {
ok( shouldTriggerWidget, "bar called from _on" );
}
});
- element.bind( "foo bar", function( event ) {
+ element.on( "foo bar", function( event ) {
ok( shouldTriggerOther, event.type + " called from bind" );
});
shouldTriggerWidget = true;
@@ -1059,7 +1059,7 @@ test( "_off() - all events", function() {
ok( shouldTriggerWidget, "bar called from _on" );
}
});
- element.bind( "foo bar", function( event ) {
+ element.on( "foo bar", function( event ) {
ok( shouldTriggerOther, event.type + " called from bind" );
});
shouldTriggerWidget = true;
@@ -1152,7 +1152,7 @@ test( "._trigger() - no event, no ui", function() {
}
});
$( document ).add( "#widget-wrapper" ).add( "#widget" )
- .bind( "testwidgetfoo", function( event, ui ) {
+ .on( "testwidgetfoo", function( event, ui ) {
deepEqual( ui, {}, "empty ui hash passed" );
handlers.push( this );
});
@@ -1165,7 +1165,7 @@ test( "._trigger() - no event, no ui", function() {
"callback"
], "event bubbles and then invokes callback" );
- $( document ).unbind( "testwidgetfoo" );
+ $( document ).off( "testwidgetfoo" );
});
test( "._trigger() - cancelled event", function() {
@@ -1180,7 +1180,7 @@ test( "._trigger() - cancelled event", function() {
ok( true, "callback invoked even if event is cancelled" );
}
})
- .bind( "testwidgetfoo", function() {
+ .on( "testwidgetfoo", function() {
ok( true, "event was triggered" );
return false;
});
@@ -1227,7 +1227,7 @@ test( "._trigger() - provide event and ui", function() {
}, "ui object modified" );
}
});
- $( "#widget" ).bind( "testwidgetfoo", function( event, ui ) {
+ $( "#widget" ).on( "testwidgetfoo", function( event, ui ) {
equal( event.originalEvent, originalEvent, "original event object passed" );
deepEqual( ui, {
foo: "bar",
@@ -1238,7 +1238,7 @@ test( "._trigger() - provide event and ui", function() {
}, "ui hash passed" );
ui.foo = "notbar";
});
- $( "#widget-wrapper" ).bind( "testwidgetfoo", function( event, ui ) {
+ $( "#widget-wrapper" ).on( "testwidgetfoo", function( event, ui ) {
equal( event.originalEvent, originalEvent, "original event object passed" );
deepEqual( ui, {
foo: "notbar",
@@ -1285,7 +1285,7 @@ test( "._trigger() - array as ui", function() {
this._trigger( "foo", null, [ ui, extra ] );
}
});
- $( "#widget" ).bind( "testwidgetfoo", function( event, ui, extra ) {
+ $( "#widget" ).on( "testwidgetfoo", function( event, ui, extra ) {
deepEqual( ui, {
foo: "bar",
baz: {
@@ -1328,7 +1328,7 @@ test( "._trigger() - instance as element", function() {
deepEqual( ui, { foo: "bar" }, "ui object passed to callback" );
}
});
- $( instance ).bind( "testwidgetfoo", function( event, ui ) {
+ $( instance ).on( "testwidgetfoo", function( event, ui ) {
equal( event.type, "testwidgetfoo", "event object passed to event handler" );
deepEqual( ui, { foo: "bar" }, "ui object passed to event handler" );
});