diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2015-01-08 13:35:28 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2015-01-11 21:11:56 -0500 |
commit | 0ea8c32863af31fb5cfc184e8d513bbae35583e8 (patch) | |
tree | 28aa7d751e6f5ee5a785c890b82b767324eb9410 /test/unit | |
parent | 89ce0af2cf7f001647e74fc1de92ce94a51fd5c2 (diff) | |
download | jquery-0ea8c32863af31fb5cfc184e8d513bbae35583e8.tar.gz jquery-0ea8c32863af31fb5cfc184e8d513bbae35583e8.zip |
Core: Remove deprecated context and selector properties
Fixes gh-1908
Closes gh-2000
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/core.js | 45 | ||||
-rw-r--r-- | test/unit/offset.js | 6 |
2 files changed, 4 insertions, 47 deletions
diff --git a/test/unit/core.js b/test/unit/core.js index 034473b5c..1852a427a 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -57,7 +57,7 @@ test("jQuery()", function() { equal( jQuery(undefined).length, 0, "jQuery(undefined) === jQuery([])" ); equal( jQuery(null).length, 0, "jQuery(null) === jQuery([])" ); equal( jQuery("").length, 0, "jQuery('') === jQuery([])" ); - equal( jQuery(obj).selector, "div", "jQuery(jQueryObj) == jQueryObj" ); + deepEqual( jQuery(obj).get(), obj.get(), "jQuery(jQueryObj) == jQueryObj" ); // Invalid #id goes to Sizzle which will throw an error (gh-1682) try { @@ -156,49 +156,6 @@ test("jQuery(selector, context)", function() { deepEqual( jQuery("div p", jQuery("#qunit-fixture")).get(), q("sndp", "en", "sap"), "Basic selector with jQuery object as context" ); }); -test( "selector state", function() { - expect( 18 ); - - var test; - - test = jQuery( undefined ); - equal( test.selector, "", "Empty jQuery Selector" ); - equal( test.context, undefined, "Empty jQuery Context" ); - - test = jQuery( document ); - equal( test.selector, "", "Document Selector" ); - equal( test.context, document, "Document Context" ); - - test = jQuery( document.body ); - equal( test.selector, "", "Body Selector" ); - equal( test.context, document.body, "Body Context" ); - - test = jQuery("#qunit-fixture"); - equal( test.selector, "#qunit-fixture", "#qunit-fixture Selector" ); - equal( test.context, document, "#qunit-fixture Context" ); - - test = jQuery("#notfoundnono"); - equal( test.selector, "#notfoundnono", "#notfoundnono Selector" ); - equal( test.context, document, "#notfoundnono Context" ); - - test = jQuery( "#qunit-fixture", document ); - equal( test.selector, "#qunit-fixture", "#qunit-fixture Selector" ); - equal( test.context, document, "#qunit-fixture Context" ); - - test = jQuery( "#qunit-fixture", document.body ); - equal( test.selector, "#qunit-fixture", "#qunit-fixture Selector" ); - equal( test.context, document.body, "#qunit-fixture Context" ); - - // Test cloning - test = jQuery( test ); - equal( test.selector, "#qunit-fixture", "#qunit-fixture Selector" ); - equal( test.context, document.body, "#qunit-fixture Context" ); - - test = jQuery( document.body ).find("#qunit-fixture"); - equal( test.selector, "#qunit-fixture", "#qunit-fixture find Selector" ); - equal( test.context, document.body, "#qunit-fixture find Context" ); -}); - test( "globalEval", function() { expect( 3 ); Globals.register("globalEvalTest"); diff --git a/test/unit/offset.js b/test/unit/offset.js index ab81a703d..2f1784ca5 100644 --- a/test/unit/offset.js +++ b/test/unit/offset.js @@ -462,9 +462,9 @@ testIframe("offset/body", "body", function( $ ) { test("chaining", function() { expect(3); var coords = { "top": 1, "left": 1 }; - equal( jQuery("#absolute-1").offset(coords).selector, "#absolute-1", "offset(coords) returns jQuery object" ); - equal( jQuery("#non-existent").offset(coords).selector, "#non-existent", "offset(coords) with empty jQuery set returns jQuery object" ); - equal( jQuery("#absolute-1").offset(undefined).selector, "#absolute-1", "offset(undefined) returns jQuery object (#5571)" ); + equal( jQuery("#absolute-1").offset(coords).jquery, jQuery.fn.jquery, "offset(coords) returns jQuery object" ); + equal( jQuery("#non-existent").offset(coords).jquery, jQuery.fn.jquery, "offset(coords) with empty jQuery set returns jQuery object" ); + equal( jQuery("#absolute-1").offset(undefined).jquery, jQuery.fn.jquery, "offset(undefined) returns jQuery object (#5571)" ); }); test("offsetParent", function(){ |