diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2013-09-11 22:11:58 +0200 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2013-09-11 22:26:34 +0200 |
commit | 6e799c39d33be8eee02224d2f754dc42228a4cbb (patch) | |
tree | a6134169056aa77286a821ba7f432026d7938881 /tests | |
parent | 37bba1eb920298994903e866625bb662f391a1f5 (diff) | |
download | jquery-ui-6e799c39d33be8eee02224d2f754dc42228a4cbb.tar.gz jquery-ui-6e799c39d33be8eee02224d2f754dc42228a4cbb.zip |
Widget Bridge: Make the _init method optional. Add tests for both states. Fixes #9543 - Widget bridge: Make _init() optional.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/widget/widget_core.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/unit/widget/widget_core.js b/tests/unit/widget/widget_core.js index 3db79ec06..ec4c85874 100644 --- a/tests/unit/widget/widget_core.js +++ b/tests/unit/widget/widget_core.js @@ -1409,7 +1409,7 @@ asyncTest( "_delay", function() { }); test( "$.widget.bridge()", function() { - expect( 10 ); + expect( 14 ); var instance, ret, elem = $( "<div>" ); @@ -1427,6 +1427,9 @@ test( "$.widget.bridge()", function() { }, getter: function() { return "qux"; + }, + option: function( options ) { + deepEqual( options, {} ); } }); @@ -1444,6 +1447,14 @@ test( "$.widget.bridge()", function() { ret = elem.testWidget( "getter" ); equal( ret, "qux", "getter returns value" ); + + elem.testWidget(); + ok( true, "_init is optional" ); + + TestWidget.prototype._init = function() { + ok( "_init", "_init now exists, so its called" ); + }; + elem.testWidget(); }); test( "$.widget.bridge() - widgetFullName", function() { |