jQuery: The Write Less, Do More JavaScript Library

Changeset 5505

Show
Ignore:
Timestamp:
05/08/08 17:16:49 (3 days ago)
Author:
aflesler
Message:

test runner: added 2 tests for [5500]

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/jquery/test/unit/core.js

    r5504 r5505  
    301301 
    302302test("index(Object)", function() { 
    303     expect(8); 
    304     equals( $([window, document]).index(window), 0, "Check for index of elements" ); 
    305     equals( $([window, document]).index(document), 1, "Check for index of elements" ); 
    306     var inputElements = $('#radio1,#radio2,#check1,#check2'); 
     303    expect(10); 
     304     
     305    var elements = $([window, document]), 
     306        inputElements = $('#radio1,#radio2,#check1,#check2'); 
     307     
     308    equals( elements.index(window), 0, "Check for index of elements" ); 
     309    equals( elements.index(document), 1, "Check for index of elements" ); 
    307310    equals( inputElements.index(document.getElementById('radio1')), 0, "Check for index of elements" ); 
    308311    equals( inputElements.index(document.getElementById('radio2')), 1, "Check for index of elements" ); 
     
    311314    equals( inputElements.index(window), -1, "Check for not found index" ); 
    312315    equals( inputElements.index(document), -1, "Check for not found index" ); 
     316     
     317    // enabled since [5500] 
     318    equals( elements.index( elements ), 0, "Pass in a jQuery object" ); 
     319    equals( elements.index( elements.eq(1) ), 1, "Pass in a jQuery object" ); 
    313320}); 
    314321