aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorShashanka Nataraj <shashankan.10@gmail.com>2017-06-23 04:14:43 +0000
committerTimmy Willison <4timmywil@gmail.com>2017-07-10 12:00:27 -0400
commitc18d608537d8945de6c5855a9475657177fa74ac (patch)
tree1d1dee3376abc5218d3c0da26f540003d9b70f05 /test
parent490db839fb08a9b461e77dbe0138c7e6045aacd8 (diff)
downloadjquery-c18d608537d8945de6c5855a9475657177fa74ac.tar.gz
jquery-c18d608537d8945de6c5855a9475657177fa74ac.zip
Core: Deprecate jQuery.isWindow
Fixes gh-3629 Close gh-3702
Diffstat (limited to 'test')
-rw-r--r--test/unit/basic.js5
-rw-r--r--test/unit/core.js19
-rw-r--r--test/unit/deprecated.js19
3 files changed, 20 insertions, 23 deletions
diff --git a/test/unit/basic.js b/test/unit/basic.js
index 5a2f5abc2..15bca8ff6 100644
--- a/test/unit/basic.js
+++ b/test/unit/basic.js
@@ -76,7 +76,7 @@ QUnit.test( "show/hide", function( assert ) {
}
QUnit.test( "core", function( assert ) {
- assert.expect( 27 );
+ assert.expect( 25 );
var elem = jQuery( "<div></div><span></span>" );
@@ -100,9 +100,6 @@ QUnit.test( "core", function( assert ) {
"<?xml version='1.0' encoding='UTF-8'?><foo bar='baz'></foo>"
) ), "jQuery.isXMLDoc" );
- assert.ok( jQuery.isWindow( window ), "jQuery.isWindow(window)" );
- assert.ok( !jQuery.isWindow( 2 ), "jQuery.isWindow(Number)" );
-
assert.strictEqual( jQuery.inArray( 3, [ "a", 6, false, 3, {} ] ), 3, "jQuery.inArray - true" );
assert.strictEqual(
jQuery.inArray( 3, [ "a", 6, false, "3", {} ] ),
diff --git a/test/unit/core.js b/test/unit/core.js
index 66a18268c..322b21dc6 100644
--- a/test/unit/core.js
+++ b/test/unit/core.js
@@ -680,25 +680,6 @@ QUnit.test( "isXMLDoc - XML", function( assert ) {
assert.ok( jQuery.isXMLDoc( jQuery( "tab", xml )[ 0 ] ), "XML Tab Element" );
} );
-QUnit.test( "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" );
-} );
-
QUnit.test( "jQuery('html')", function( assert ) {
assert.expect( 18 );
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" );
+} );