Bug Tracker

Ticket #3154: split-elements-testcase.diff

File split-elements-testcase.diff, 1.8 KB (added by joern, 12 years ago)
  • test/unit/core.js

     
    258258});
    259259
    260260test("add(String|Element|Array|undefined)", function() {
    261         expect(12);
     261        expect(13);
    262262        isSet( jQuery("#sndp").add("#en").add("#sap").get(), q("sndp", "en", "sap"), "Check elements from document" );
    263263        isSet( jQuery("#sndp").add( jQuery("#en")[0] ).add( jQuery("#sap") ).get(), q("sndp", "en", "sap"), "Check elements from document" );
    264264        ok( jQuery([]).add(jQuery("#form")[0].elements).length >= 13, "Check elements from array" );
     
    266266        // For the time being, we're discontinuing support for jQuery(form.elements) since it's ambiguous in IE
    267267        // use jQuery([]).add(form.elements) instead.
    268268        //equals( jQuery([]).add(jQuery("#form")[0].elements).length, jQuery(jQuery("#form")[0].elements).length, "Array in constructor must equals array in add()" );
     269       
     270        equals( jQuery([]).add(jQuery("#splitform")[0].elements).length, 2, "should be jQuery object with two elements, but is jQuery object with array with two elements" );
    269271
    270272        var x = jQuery([]).add(jQuery("<p id='x1'>xxx</p>")).add(jQuery("<p id='x2'>xxx</p>"));
    271273        equals( x[0].id, "x1", "Check on-the-fly element1" );
  • test/index.html

     
    5151                <p id="first">Try them out:</p>
    5252                <ul id="firstUL"></ul>
    5353                <ol id="empty"></ol>
     54                <form id="splitform">
     55                        <input name="split" id="split1" />
     56                        <input name="xxx" id="split1" />
     57                </form>
    5458                <form id="form" action="formaction">
    5559                        <input type="text" name="action" value="Test" id="text1" maxlength="30"/>
    5660                        <input type="text" name="text2" value="Test" id="text2" disabled="disabled"/>