aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/widget
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2016-08-04 09:04:16 -0400
committerScott González <scott.gonzalez@gmail.com>2016-08-04 09:04:49 -0400
commit3dd8a09b441d65445f2b6a7c73e72af65445d5da (patch)
treefd2061f01c4222be98395c6e6772bc95056e9ffa /tests/unit/widget
parent57537d09a42ed53d6244d9222d954e107b2b44d0 (diff)
downloadjquery-ui-3dd8a09b441d65445f2b6a7c73e72af65445d5da.tar.gz
jquery-ui-3dd8a09b441d65445f2b6a7c73e72af65445d5da.zip
Widget: `instance()` should return `undefined` for empty sets
Fixes #15019
Diffstat (limited to 'tests/unit/widget')
-rw-r--r--tests/unit/widget/core.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/unit/widget/core.js b/tests/unit/widget/core.js
index 00dcb1611..d6bb3efb8 100644
--- a/tests/unit/widget/core.js
+++ b/tests/unit/widget/core.js
@@ -786,7 +786,7 @@ QUnit.test( ".widget() - overriden", function( assert ) {
} );
QUnit.test( ".instance()", function( assert ) {
- assert.expect( 2 );
+ assert.expect( 3 );
var div;
$.widget( "ui.testWidget", {
@@ -794,9 +794,11 @@ QUnit.test( ".instance()", function( assert ) {
} );
div = $( "<div>" );
- assert.equal( div.testWidget( "instance" ), undefined );
+ assert.equal( div.testWidget( "instance" ), undefined, "uninitialized" );
div.testWidget();
- assert.equal( div.testWidget( "instance" ), div.testWidget( "instance" ) );
+ assert.equal( div.testWidget( "instance" ), div.testWidget( "instance" ), "initialized" );
+
+ assert.equal( $().testWidget( "instance" ), undefined, "empty set" );
} );
QUnit.test( "._on() to element (default)", function( assert ) {