Bug Tracker

Ticket #2811: testrunner-add.diff

File testrunner-add.diff, 1.1 KB (added by flesler, 12 years ago)

Tests that can now pass

  • unit/core.js

     
    261261});
    262262
    263263test("add(String|Element|Array|undefined)", function() {
    264         expect(8);
     264        expect(12);
    265265        isSet( $("#sndp").add("#en").add("#sap").get(), q("sndp", "en", "sap"), "Check elements from document" );
    266266        isSet( $("#sndp").add( $("#en")[0] ).add( $("#sap") ).get(), q("sndp", "en", "sap"), "Check elements from document" );
    267267        equals( $([]).add($("#form")[0].elements).length, 15, "Check elements from array" );
     
    280280       
    281281        var notDefined;
    282282        equals( $([]).add(notDefined).length, 0, "Check that undefined adds nothing" );
     283       
     284        equals( $([]).add([window,document,document.body,document]).length, 3, "Pass an array" );
     285        equals( $(document).add(document).length, 1, "Check duplicated elements" );
     286        equals( $(window).add(window).length, 1, "Check duplicated elements using the window" );
     287        equals( $([]).add( document.getElementById('form') ).length, 15, "Add a form (adds the elements)" );
    283288});
    284289
    285290test("each(Function)", function() {