diff options
author | Shashanka Nataraj <shashankan.10@gmail.com> | 2017-06-23 04:14:43 +0000 |
---|---|---|
committer | Timmy Willison <4timmywil@gmail.com> | 2017-07-10 12:00:27 -0400 |
commit | c18d608537d8945de6c5855a9475657177fa74ac (patch) | |
tree | 1d1dee3376abc5218d3c0da26f540003d9b70f05 /test/unit/deprecated.js | |
parent | 490db839fb08a9b461e77dbe0138c7e6045aacd8 (diff) | |
download | jquery-c18d608537d8945de6c5855a9475657177fa74ac.tar.gz jquery-c18d608537d8945de6c5855a9475657177fa74ac.zip |
Core: Deprecate jQuery.isWindow
Fixes gh-3629
Close gh-3702
Diffstat (limited to 'test/unit/deprecated.js')
-rw-r--r-- | test/unit/deprecated.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/unit/deprecated.js b/test/unit/deprecated.js index 5c05d9b00..f555ac655 100644 --- a/test/unit/deprecated.js +++ b/test/unit/deprecated.js @@ -164,3 +164,22 @@ QUnit.test( "jQuery.nodeName", function( assert ) { "Works on custom elements (true)" ); } ); + +QUnit.test( "jQuery.isWindow", function( assert ) { + assert.expect( 14 ); + + assert.ok( jQuery.isWindow( window ), "window" ); + assert.ok( jQuery.isWindow( document.getElementsByTagName( "iframe" )[ 0 ].contentWindow ), "iframe.contentWindow" ); + assert.ok( !jQuery.isWindow(), "empty" ); + assert.ok( !jQuery.isWindow( null ), "null" ); + assert.ok( !jQuery.isWindow( undefined ), "undefined" ); + assert.ok( !jQuery.isWindow( document ), "document" ); + assert.ok( !jQuery.isWindow( document.documentElement ), "documentElement" ); + assert.ok( !jQuery.isWindow( "" ), "string" ); + assert.ok( !jQuery.isWindow( 1 ), "number" ); + assert.ok( !jQuery.isWindow( true ), "boolean" ); + assert.ok( !jQuery.isWindow( {} ), "object" ); + assert.ok( !jQuery.isWindow( { setInterval: function() {} } ), "fake window" ); + assert.ok( !jQuery.isWindow( /window/ ), "regexp" ); + assert.ok( !jQuery.isWindow( function() {} ), "function" ); +} ); |