');
ok( true, "Check for \\r and \\n in jQuery()" );
+ /* // Disabled until we add this functionality in
var pass = true;
try {
- var f = document.getElementById("iframe").contentDocument;
- f.open();
- f.write("");
- f.close();
- $("
Testing
").appendTo(f.body);
+ $("
Testing
").appendTo(document.getElementById("iframe").contentDocument.body);
} catch(e){
pass = false;
}
- ok( pass, "$('<tag>') needs optional document parameter to ease cross-frame DOM wrangling, see #968" );
+ ok( pass, "$('<tag>') needs optional document parameter to ease cross-frame DOM wrangling, see #968" );*/
});
test("isFunction", function() {
@@ -119,31 +116,43 @@ test("isFunction", function() {
});
});
+test("$('html')", function() {
+ expect(2);
+
+ reset();
+ ok( $("")[0], "Creating a script" );
+
+ reset();
+ ok( $("")[0], "Creating a link" );
+
+ reset();
+});
+
test("length", function() {
expect(1);
- ok( $("div").length == 2, "Get Number of Elements Found" );
+ ok( $("p").length == 6, "Get Number of Elements Found" );
});
test("size()", function() {
expect(1);
- ok( $("div").size() == 2, "Get Number of Elements Found" );
+ ok( $("p").size() == 6, "Get Number of Elements Found" );
});
test("get()", function() {
expect(1);
- isSet( $("div").get(), q("main","foo"), "Get All Elements" );
+ isSet( $("p").get(), q("firstp","ap","sndp","en","sap","first"), "Get All Elements" );
});
test("get(Number)", function() {
expect(1);
- ok( $("div").get(0) == document.getElementById("main"), "Get A Single Element" );
+ ok( $("p").get(0) == document.getElementById("firstp"), "Get A Single Element" );
});
test("add(String|Element|Array)", function() {
expect(7);
isSet( $("#sndp").add("#en").add("#sap").get(), q("sndp", "en", "sap"), "Check elements from document" );
isSet( $("#sndp").add( $("#en")[0] ).add( $("#sap") ).get(), q("sndp", "en", "sap"), "Check elements from document" );
- ok( $([]).add($("#form")[0].elements).length > 13, "Check elements from array" );
+ ok( $([]).add($("#form")[0].elements).length >= 13, "Check elements from array" );
var x = $([]).add($("
xxx
")).add($("
xxx
"));
ok( x[0].id == "x1", "Check on-the-fly element1" );
@@ -197,17 +206,15 @@ test("attr(String)", function() {
ok( $('#tAnchor5').attr('href') == "#5", 'Check for non-absolute href (an anchor)' );
});
-if ( location.protocol != "file:" ) {
- test("attr(String) in XML Files", function() {
- expect(2);
- stop();
- $.get("data/dashboard.xml", function(xml) {
- ok( $("locations", xml).attr("class") == "foo", "Check class attribute in XML document" );
- ok( $("location", xml).attr("for") == "bar", "Check for attribute in XML document" );
- start();
- });
+test("attr(String) in XML Files", function() {
+ expect(2);
+ stop();
+ $.get("data/dashboard.xml", function(xml) {
+ ok( $("locations", xml).attr("class") == "foo", "Check class attribute in XML document" );
+ ok( $("location", xml).attr("for") == "bar", "Check for attribute in XML document" );
+ start();
});
-}
+});
test("attr(String, Function)", function() {
expect(2);
@@ -250,21 +257,19 @@ test("attr(String, Object)", function() {
ok( document.getElementById('name').maxLength == '5', 'Set maxlength attribute' );
});
-if ( location.protocol != "file:" ) {
- test("attr(String, Object)x", function() {
- expect(2);
- stop();
- $.get('data/dashboard.xml', function(xml) {
- var titles = [];
- $('tab', xml).each(function() {
- titles.push($(this).attr('title'));
- });
- ok( titles[0] == 'Location', 'attr() in XML context: Check first title' );
- ok( titles[1] == 'Users', 'attr() in XML context: Check second title' );
- start();
- });
+test("attr(String, Object) - Loaded via XML document", function() {
+ expect(2);
+ stop();
+ $.get('data/dashboard.xml', function(xml) {
+ var titles = [];
+ $('tab', xml).each(function() {
+ titles.push($(this).attr('title'));
+ });
+ ok( titles[0] == 'Location', 'attr() in XML context: Check first title' );
+ ok( titles[1] == 'Users', 'attr() in XML context: Check second title' );
+ start();
});
-}
+});
test("css(String|Hash)", function() {
expect(19);
@@ -330,7 +335,7 @@ test("text()", function() {
});
test("wrap(String|Element)", function() {
- expect(7);
+ expect(6);
var defaultText = 'Try them out:'
var result = $('#first').wrap('
').text();
ok( defaultText == result, 'Check for wrapping of on-the-fly html' );
@@ -343,22 +348,22 @@ test("wrap(String|Element)", function() {
ok( result.text() == defaultText, 'Check for element wrapping' );
reset();
- stop();
+ //stop();
$('#check1').click(function() {
var checkbox = this;
ok( checkbox.checked, "Checkbox's state is erased after wrap() action, see #769" );
$(checkbox).wrap( '' );
ok( checkbox.checked, "Checkbox's state is erased after wrap() action, see #769" );
// use a fade in to check state after this event handler has finished
- setTimeout(function() {
+ /*setTimeout(function() {
ok( !checkbox.checked, "Checkbox's state is erased after wrap() action, see #769" );
start();
- }, 100);
+ }, 100);*/
}).click();
});
test("append(String|Element|Array<Element>|jQuery)", function() {
- expect(17);
+ expect(18);
var defaultText = 'Try them out:'
var result = $('#first').append('buga');
ok( result.text() == defaultText + 'buga', 'Check if text appending works' );
@@ -407,7 +412,7 @@ test("append(String|Element|Array<Element>|jQuery)", function() {
ok( pass, "Test for appending a DOM node to the contents of an IFrame" );
reset();
- $('