Added a fix for bug #1489, appending <caption> was broken.
[jquery.git] / src / jquery / coreTest.js
index ee44381..b65877a 100644 (file)
@@ -118,29 +118,29 @@ test("isFunction", function() {
 
 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($("<p id='x1'>xxx</p>")).add($("<p id='x2'>xxx</p>"));
        ok( x[0].id == "x1", "Check on-the-fly element1" );
@@ -355,7 +355,7 @@ test("wrap(String|Element)", function() {
 });
 
 test("append(String|Element|Array&lt;Element&gt;|jQuery)", function() {
-       expect(17);
+       expect(18);
        var defaultText = 'Try them out:'
        var result = $('#first').append('<b>buga</b>');
        ok( result.text() == defaultText + 'buga', 'Check if text appending works' );
@@ -418,6 +418,10 @@ test("append(String|Element|Array&lt;Element&gt;|jQuery)", function() {
        ok( $('#table colgroup col').length, "Append col" );
        
        reset();
+       $('#table').append('<caption></caption>');
+       ok( $('#table caption').length, "Append caption" );
+
+       reset();
        $('form:last')
                .append('<select id="appendSelect1"></select>')
                .append('<select id="appendSelect2"><option>Test</option></select>');