mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Fix #11962. Standardize getter return values for empty sets.
This commit is contained in:
@@ -1351,6 +1351,11 @@ test("html(undefined)", function() {
|
||||
equal( jQuery("#foo").html("<i>test</i>").html(undefined).html().toLowerCase(), "<i>test</i>", ".html(undefined) is chainable (#5571)" );
|
||||
});
|
||||
|
||||
test("html() on empty set", function() {
|
||||
expect(1);
|
||||
strictEqual( jQuery( ).html(), undefined, ".html() returns undefined for empty sets (#11962)" );
|
||||
});
|
||||
|
||||
var testHtml = function(valueObj) {
|
||||
expect(35);
|
||||
|
||||
|
||||
@@ -9,6 +9,12 @@ module("offset", { teardown: moduleTeardown });
|
||||
the iframe window and the "jQuery" symbol is used to access any static methods.
|
||||
*/
|
||||
|
||||
test("empty set", function() {
|
||||
expect(2);
|
||||
strictEqual( jQuery( ).offset(), undefined, "offset() returns undefined for empty set (#11962)" );
|
||||
strictEqual( jQuery( ).position(), undefined, "position() returns undefined for empty set (#11962)" );
|
||||
});
|
||||
|
||||
test("disconnected node", function() {
|
||||
expect(2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user