Commit c0fe98f0 authored by John Resig's avatar John Resig

Tweak more element orders in the manipulation tests. Also differentiate...

Tweak more element orders in the manipulation tests. Also differentiate between iframe test failing and the inability to access iframe internals (as in the case of Blackberry).
parent 3b76b588
...@@ -262,10 +262,12 @@ var testAppend = function(valueObj) { ...@@ -262,10 +262,12 @@ var testAppend = function(valueObj) {
QUnit.reset(); QUnit.reset();
var pass = true; var pass = true;
try { try {
jQuery( jQuery("#iframe")[0].contentWindow.document.body ).append(valueObj( "<div>test</div>" )); var body = jQuery("#iframe")[0].contentWindow.document.body;
} catch(e) {
pass = false; pass = false;
} jQuery( document.body ).append(valueObj( "<div>test</div>" ));
pass = true;
} catch(e) {}
ok( pass, "Test for appending a DOM node to the contents of an IFrame" ); ok( pass, "Test for appending a DOM node to the contents of an IFrame" );
...@@ -359,7 +361,7 @@ test("append(Function) with incoming value", function() { ...@@ -359,7 +361,7 @@ test("append(Function) with incoming value", function() {
jQuery('#sap').append(function(i, val){ jQuery('#sap').append(function(i, val){
equals( val, old, "Make sure the incoming value is correct." ); equals( val, old, "Make sure the incoming value is correct." );
return jQuery("#first, #yahoo"); return jQuery("#yahoo, #first");
}); });
equals( expected, jQuery('#sap').text(), "Check for appending of jQuery object" ); equals( expected, jQuery('#sap').text(), "Check for appending of jQuery object" );
...@@ -407,7 +409,7 @@ test("appendTo(String|Element|Array&lt;Element&gt;|jQuery)", function() { ...@@ -407,7 +409,7 @@ test("appendTo(String|Element|Array&lt;Element&gt;|jQuery)", function() {
QUnit.reset(); QUnit.reset();
expected = "This link has class=\"blog\": Simon Willison's WeblogYahooTry them out:"; expected = "This link has class=\"blog\": Simon Willison's WeblogYahooTry them out:";
jQuery("#first, #yahoo").appendTo('#sap'); jQuery("#yahoo, #first").appendTo('#sap');
equals( expected, jQuery('#sap').text(), "Check for appending of jQuery object" ); equals( expected, jQuery('#sap').text(), "Check for appending of jQuery object" );
QUnit.reset(); QUnit.reset();
...@@ -469,7 +471,7 @@ var testPrepend = function(val) { ...@@ -469,7 +471,7 @@ var testPrepend = function(val) {
QUnit.reset(); QUnit.reset();
expected = "YahooTry them out:This link has class=\"blog\": Simon Willison's Weblog"; expected = "YahooTry them out:This link has class=\"blog\": Simon Willison's Weblog";
jQuery('#sap').prepend(val( jQuery("#first, #yahoo") )); jQuery('#sap').prepend(val( jQuery("#yahoo, #first") ));
equals( expected, jQuery('#sap').text(), "Check for prepending of jQuery object" ); equals( expected, jQuery('#sap').text(), "Check for prepending of jQuery object" );
}; };
...@@ -526,7 +528,7 @@ test("prepend(Function) with incoming value", function() { ...@@ -526,7 +528,7 @@ test("prepend(Function) with incoming value", function() {
jQuery('#sap').prepend(function(i, val) { jQuery('#sap').prepend(function(i, val) {
equals( val, old, "Make sure the incoming value is correct." ); equals( val, old, "Make sure the incoming value is correct." );
return jQuery("#first, #yahoo"); return jQuery("#yahoo, #first");
}); });
equals( expected, jQuery('#sap').text(), "Check for prepending of jQuery object" ); equals( expected, jQuery('#sap').text(), "Check for prepending of jQuery object" );
...@@ -551,7 +553,7 @@ test("prependTo(String|Element|Array&lt;Element&gt;|jQuery)", function() { ...@@ -551,7 +553,7 @@ test("prependTo(String|Element|Array&lt;Element&gt;|jQuery)", function() {
QUnit.reset(); QUnit.reset();
expected = "YahooTry them out:This link has class=\"blog\": Simon Willison's Weblog"; expected = "YahooTry them out:This link has class=\"blog\": Simon Willison's Weblog";
jQuery("#first, #yahoo").prependTo('#sap'); jQuery("#yahoo, #first").prependTo('#sap');
equals( expected, jQuery('#sap').text(), "Check for prepending of jQuery object" ); equals( expected, jQuery('#sap').text(), "Check for prepending of jQuery object" );
QUnit.reset(); QUnit.reset();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment