QUnit.reset();
var expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:";
jQuery('#sap').append(valueObj(document.getElementById('first')));
- equals( expected, jQuery('#sap').text(), "Check for appending of element" );
+ equals( jQuery('#sap').text(), expected, "Check for appending of element" );
QUnit.reset();
expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:Yahoo";
jQuery('#sap').append(valueObj([document.getElementById('first'), document.getElementById('yahoo')]));
- equals( expected, jQuery('#sap').text(), "Check for appending of array of elements" );
+ equals( jQuery('#sap').text(), expected, "Check for appending of array of elements" );
QUnit.reset();
expected = "This link has class=\"blog\": Simon Willison's WeblogYahooTry them out:";
jQuery('#sap').append(valueObj(jQuery("#yahoo, #first")));
- equals( expected, jQuery('#sap').text(), "Check for appending of jQuery object" );
+ equals( jQuery('#sap').text(), expected, "Check for appending of jQuery object" );
QUnit.reset();
jQuery("#sap").append(valueObj( 5 ));
equals( val, old, "Make sure the incoming value is correct." );
return document.getElementById('first');
});
- equals( expected, jQuery('#sap').text(), "Check for appending of element" );
+ equals( jQuery('#sap').text(), expected, "Check for appending of element" );
QUnit.reset();
expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:Yahoo";
equals( val, old, "Make sure the incoming value is correct." );
return [document.getElementById('first'), document.getElementById('yahoo')];
});
- equals( expected, jQuery('#sap').text(), "Check for appending of array of elements" );
+ equals( jQuery('#sap').text(), expected, "Check for appending of array of elements" );
QUnit.reset();
expected = "This link has class=\"blog\": Simon Willison's WeblogYahooTry them out:";
equals( val, old, "Make sure the incoming value is correct." );
return jQuery("#yahoo, #first");
});
- equals( expected, jQuery('#sap').text(), "Check for appending of jQuery object" );
+ equals( jQuery('#sap').text(), expected, "Check for appending of jQuery object" );
QUnit.reset();
old = jQuery("#sap").html();
QUnit.reset();
var expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:";
jQuery(document.getElementById('first')).appendTo('#sap');
- equals( expected, jQuery('#sap').text(), "Check for appending of element" );
+ equals( jQuery('#sap').text(), expected, "Check for appending of element" );
QUnit.reset();
expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:Yahoo";
jQuery([document.getElementById('first'), document.getElementById('yahoo')]).appendTo('#sap');
- equals( expected, jQuery('#sap').text(), "Check for appending of array of elements" );
+ equals( jQuery('#sap').text(), expected, "Check for appending of array of elements" );
QUnit.reset();
ok( jQuery(document.createElement("script")).appendTo("body").length, "Make sure a disconnected script can be appended." );
QUnit.reset();
expected = "This link has class=\"blog\": Simon Willison's WeblogYahooTry them out:";
jQuery("#yahoo, #first").appendTo('#sap');
- equals( expected, jQuery('#sap').text(), "Check for appending of jQuery object" );
+ equals( jQuery('#sap').text(), expected, "Check for appending of jQuery object" );
QUnit.reset();
jQuery('#select1').appendTo('#foo');
QUnit.reset();
var expected = "Try them out:This link has class=\"blog\": Simon Willison's Weblog";
jQuery('#sap').prepend(val( document.getElementById('first') ));
- equals( expected, jQuery('#sap').text(), "Check for prepending of element" );
+ equals( jQuery('#sap').text(), expected, "Check for prepending of element" );
QUnit.reset();
expected = "Try them out:YahooThis link has class=\"blog\": Simon Willison's Weblog";
jQuery('#sap').prepend(val( [document.getElementById('first'), document.getElementById('yahoo')] ));
- equals( expected, jQuery('#sap').text(), "Check for prepending of array of elements" );
+ equals( jQuery('#sap').text(), expected, "Check for prepending of array of elements" );
QUnit.reset();
expected = "YahooTry them out:This link has class=\"blog\": Simon Willison's Weblog";
jQuery('#sap').prepend(val( jQuery("#yahoo, #first") ));
- equals( expected, jQuery('#sap').text(), "Check for prepending of jQuery object" );
+ equals( jQuery('#sap').text(), expected, "Check for prepending of jQuery object" );
};
test("prepend(String|Element|Array<Element>|jQuery)", function() {
return document.getElementById('first');
});
- equals( expected, jQuery('#sap').text(), "Check for prepending of element" );
+ equals( jQuery('#sap').text(), expected, "Check for prepending of element" );
QUnit.reset();
expected = "Try them out:YahooThis link has class=\"blog\": Simon Willison's Weblog";
return [document.getElementById('first'), document.getElementById('yahoo')];
});
- equals( expected, jQuery('#sap').text(), "Check for prepending of array of elements" );
+ equals( jQuery('#sap').text(), expected, "Check for prepending of array of elements" );
QUnit.reset();
expected = "YahooTry them out:This link has class=\"blog\": Simon Willison's Weblog";
return jQuery("#yahoo, #first");
});
- equals( expected, jQuery('#sap').text(), "Check for prepending of jQuery object" );
+ equals( jQuery('#sap').text(), expected, "Check for prepending of jQuery object" );
});
test("prependTo(String|Element|Array<Element>|jQuery)", function() {
QUnit.reset();
var expected = "Try them out:This link has class=\"blog\": Simon Willison's Weblog";
jQuery(document.getElementById('first')).prependTo('#sap');
- equals( expected, jQuery('#sap').text(), "Check for prepending of element" );
+ equals( jQuery('#sap').text(), expected, "Check for prepending of element" );
QUnit.reset();
expected = "Try them out:YahooThis link has class=\"blog\": Simon Willison's Weblog";
jQuery([document.getElementById('first'), document.getElementById('yahoo')]).prependTo('#sap');
- equals( expected, jQuery('#sap').text(), "Check for prepending of array of elements" );
+ equals( jQuery('#sap').text(), expected, "Check for prepending of array of elements" );
QUnit.reset();
expected = "YahooTry them out:This link has class=\"blog\": Simon Willison's Weblog";
jQuery("#yahoo, #first").prependTo('#sap');
- equals( expected, jQuery('#sap').text(), "Check for prepending of jQuery object" );
+ equals( jQuery('#sap').text(), expected, "Check for prepending of jQuery object" );
QUnit.reset();
jQuery('<select id="prependSelect1"></select>').prependTo('form:last');
expect(6);
var expected = 'This is a normal link: bugaYahoo';
jQuery('#yahoo').before(val( '<b>buga</b>' ));
- equals( expected, jQuery('#en').text(), 'Insert String before' );
+ equals( jQuery('#en').text(), expected, 'Insert String before' );
QUnit.reset();
expected = "This is a normal link: Try them out:Yahoo";
jQuery('#yahoo').before(val( document.getElementById('first') ));
- equals( expected, jQuery('#en').text(), "Insert element before" );
+ equals( jQuery('#en').text(), expected, "Insert element before" );
QUnit.reset();
expected = "This is a normal link: Try them out:diveintomarkYahoo";
jQuery('#yahoo').before(val( [document.getElementById('first'), document.getElementById('mark')] ));
- equals( expected, jQuery('#en').text(), "Insert array of elements before" );
+ equals( jQuery('#en').text(), expected, "Insert array of elements before" );
QUnit.reset();
expected = "This is a normal link: diveintomarkTry them out:Yahoo";
- jQuery('#yahoo').before(val( jQuery("#first, #mark") ));
- equals( expected, jQuery('#en').text(), "Insert jQuery before" );
+ jQuery('#yahoo').before(val( jQuery("#mark, #first") ));
+ equals( jQuery('#en').text(), expected, "Insert jQuery before" );
var set = jQuery("<div/>").before("<span>test</span>");
equals( set[0].nodeName.toLowerCase(), "span", "Insert the element before the disconnected node." );
expect(4);
var expected = 'This is a normal link: bugaYahoo';
jQuery('<b>buga</b>').insertBefore('#yahoo');
- equals( expected, jQuery('#en').text(), 'Insert String before' );
+ equals( jQuery('#en').text(), expected, 'Insert String before' );
QUnit.reset();
expected = "This is a normal link: Try them out:Yahoo";
jQuery(document.getElementById('first')).insertBefore('#yahoo');
- equals( expected, jQuery('#en').text(), "Insert element before" );
+ equals( jQuery('#en').text(), expected, "Insert element before" );
QUnit.reset();
expected = "This is a normal link: Try them out:diveintomarkYahoo";
jQuery([document.getElementById('first'), document.getElementById('mark')]).insertBefore('#yahoo');
- equals( expected, jQuery('#en').text(), "Insert array of elements before" );
+ equals( jQuery('#en').text(), expected, "Insert array of elements before" );
QUnit.reset();
expected = "This is a normal link: diveintomarkTry them out:Yahoo";
- jQuery("#first, #mark").insertBefore('#yahoo');
- equals( expected, jQuery('#en').text(), "Insert jQuery before" );
+ jQuery("#mark, #first").insertBefore('#yahoo');
+ equals( jQuery('#en').text(), expected, "Insert jQuery before" );
});
var testAfter = function(val) {
expect(6);
var expected = 'This is a normal link: Yahoobuga';
jQuery('#yahoo').after(val( '<b>buga</b>' ));
- equals( expected, jQuery('#en').text(), 'Insert String after' );
+ equals( jQuery('#en').text(), expected, 'Insert String after' );
QUnit.reset();
expected = "This is a normal link: YahooTry them out:";
jQuery('#yahoo').after(val( document.getElementById('first') ));
- equals( expected, jQuery('#en').text(), "Insert element after" );
+ equals( jQuery('#en').text(), expected, "Insert element after" );
QUnit.reset();
expected = "This is a normal link: YahooTry them out:diveintomark";
jQuery('#yahoo').after(val( [document.getElementById('first'), document.getElementById('mark')] ));
- equals( expected, jQuery('#en').text(), "Insert array of elements after" );
+ equals( jQuery('#en').text(), expected, "Insert array of elements after" );
QUnit.reset();
expected = "This is a normal link: YahoodiveintomarkTry them out:";
- jQuery('#yahoo').after(val( jQuery("#first, #mark") ));
- equals( expected, jQuery('#en').text(), "Insert jQuery after" );
+ jQuery('#yahoo').after(val( jQuery("#mark, #first") ));
+ equals( jQuery('#en').text(), expected, "Insert jQuery after" );
var set = jQuery("<div/>").after("<span>test</span>");
equals( set[1].nodeName.toLowerCase(), "span", "Insert the element after the disconnected node." );
expect(4);
var expected = 'This is a normal link: Yahoobuga';
jQuery('<b>buga</b>').insertAfter('#yahoo');
- equals( expected, jQuery('#en').text(), 'Insert String after' );
+ equals( jQuery('#en').text(), expected, 'Insert String after' );
QUnit.reset();
expected = "This is a normal link: YahooTry them out:";
jQuery(document.getElementById('first')).insertAfter('#yahoo');
- equals( expected, jQuery('#en').text(), "Insert element after" );
+ equals( jQuery('#en').text(), expected, "Insert element after" );
QUnit.reset();
expected = "This is a normal link: YahooTry them out:diveintomark";
jQuery([document.getElementById('first'), document.getElementById('mark')]).insertAfter('#yahoo');
- equals( expected, jQuery('#en').text(), "Insert array of elements after" );
+ equals( jQuery('#en').text(), expected, "Insert array of elements after" );
QUnit.reset();
expected = "This is a normal link: YahoodiveintomarkTry them out:";
- jQuery("#first, #mark").insertAfter('#yahoo');
- equals( expected, jQuery('#en').text(), "Insert jQuery after" );
+ jQuery("#mark, #first").insertAfter('#yahoo');
+ equals( jQuery('#en').text(), expected, "Insert jQuery after" );
});
var testReplaceWith = function(val) {
ok( !jQuery("#yahoo")[0], 'Verify that original element is gone, after array of elements' );
QUnit.reset();
- jQuery('#yahoo').replaceWith(val( jQuery("#first, #mark") ));
+ jQuery('#yahoo').replaceWith(val( jQuery("#mark, #first") ));
ok( jQuery("#first")[0], 'Replace element with set of elements' );
ok( jQuery("#mark")[0], 'Replace element with set of elements' );
ok( !jQuery("#yahoo")[0], 'Verify that original element is gone, after set of elements' );
ok( !jQuery("#yahoo")[0], 'Verify that original element is gone, after array of elements' );
QUnit.reset();
- jQuery("#first, #mark").replaceAll("#yahoo");
+ jQuery("#mark, #first").replaceAll("#yahoo");
ok( jQuery("#first")[0], 'Replace element with set of elements' );
ok( jQuery("#mark")[0], 'Replace element with set of elements' );
ok( !jQuery("#yahoo")[0], 'Verify that original element is gone, after set of elements' );