Bug Tracker

Changeset 4141

Show
Ignore:
Timestamp:
12/13/07 13:04:52 (1 year ago)
Author:
joern.zaefferer
Message:

fixed testsuite

Location:
trunk/plugins/accordion/test
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/plugins/accordion/test/index.html

    r3915 r4141  
    3030        <div id="list1"> 
    3131            <a>There is one obvious advantage:</a> 
    32             <p> 
    33                 You've seen it coming!<br/> 
    34                 Buy now and get nothing for free!<br/> 
    35                 Well, at least no free beer. Perhaps a bear, if you can afford it. 
    36             </p> 
     32            <div> 
     33                <p> 
     34                    You've seen it coming!<br/> 
     35                    Buy now and get nothing for free!<br/> 
     36                    Well, at least no free beer. Perhaps a bear, if you can afford it. 
     37                </p> 
     38            </div> 
    3739            <a>Now that you've got...</a> 
    38             <p> 
    39                 your bear, you have to admit it!<br/> 
    40                 No, we aren't selling bears. 
    41             </p> 
    42             <p> 
    43                 We could talk about renting one. 
    44             </p> 
     40            <div> 
     41                <p> 
     42                    your bear, you have to admit it!<br/> 
     43                    No, we aren't selling bears. 
     44                </p> 
     45                <p> 
     46                    We could talk about renting one. 
     47                </p> 
     48            </div> 
    4549            <a>Rent one bear, ...</a> 
    46             <p> 
    47                 get two for three beer. 
    48             </p> 
    49             <p> 
    50                 And now, for something completely different. 
    51             </p> 
     50            <div> 
     51                <p> 
     52                    get two for three beer. 
     53                </p> 
     54                <p> 
     55                    And now, for something completely different. 
     56                </p> 
     57            </div> 
    5258        </div> 
    5359         
  • trunk/plugins/accordion/test/test.js

    r3664 r4141  
    44    var args = $.makeArray(arguments).slice(1); 
    55    $.each(args, function(i, n) { 
    6         equals(n, accordion.find("p").eq(i).is(":visible")); 
     6        equals(n, accordion.find("div").eq(i).is(":visible")); 
    77    }); 
    88} 
    99 
    1010test("basics", function() { 
    11     state($('#list1').accordion(), 1, 0, 0, 0, 0); 
     11    state($('#list1').accordion(), 1, 0, 0); 
    1212}); 
    1313 
     
    2525test("activate, numeric", function() { 
    2626    var ac = $('#list1').accordion({ active: 1 }); 
    27     state(ac, 0, 1, 1, 0, 0); 
     27    state(ac, 0, 1, 0); 
    2828    ac.activate(2); 
    29     state(ac, 0, 0, 0, 1, 1); 
     29    state(ac, 0, 0, 1); 
    3030    ac.activate(0); 
    31     state(ac, 1, 0, 0, 0, 0); 
     31    state(ac, 1, 0, 0); 
    3232    ac.activate(1); 
    33     state(ac, 0, 1, 1, 0, 0); 
     33    state(ac, 0, 1, 0); 
    3434    ac.activate(2); 
    35     state(ac, 0, 0, 0, 1, 1); 
     35    state(ac, 0, 0, 1); 
    3636    ac.activate(-1); 
    37     state(ac, 0, 0, 0, 1, 1); 
     37    state(ac, 0, 0, 1); 
    3838}); 
    3939 
    4040test("activate, boolean and numeric, alwaysOpen:false", function() { 
    4141    var ac = $('#list1').accordion({alwaysOpen: false}).activate(2); 
    42     state(ac, 0, 0, 0, 1, 1); 
    43     ok("x", "----") 
    44     ac.activate(false); 
    45     state(ac, 0, 0, 0, 0, 0); 
     42    state(ac, 0, 0, 1); 
    4643    ok("x", "----") 
    4744    ac.activate(0); 
    48     state(ac, 1, 0, 0, 0, 0); 
     45    state(ac, 1, 0, 0); 
    4946    ok("x", "----") 
    5047    ac.activate(-1); 
    51     state(ac, 0, 0, 0, 0, 0); 
     48    state(ac, 0, 0, 0); 
    5249}); 
    5350 
    5451test("activate, boolean, alwaysOpen:true", function() { 
    5552    var ac = $('#list1').accordion().activate(2); 
    56     state(ac, 0, 0, 0, 1, 1); 
    57     ac.activate(false); 
    58     state(ac, 0, 0, 0, 1, 1); 
     53    state(ac, 0, 0, 1); 
     54    ac.activate(-1); 
     55    state(ac, 0, 0, 1); 
    5956}); 
    6057 
    6158test("activate, string expression", function() { 
    6259    var ac = $('#list1').accordion({ active: ":last" }); 
    63     state(ac, 0, 0, 0, 1, 1); 
     60    state(ac, 0, 0, 1); 
    6461    ac.activate(":first"); 
    65     state(ac, 1, 0, 0, 0, 0); 
     62    state(ac, 1, 0, 0); 
    6663    ac.activate(":eq(1)"); 
    67     state(ac, 0, 1, 1, 0, 0); 
     64    state(ac, 0, 1, 0); 
    6865    ac.activate(":last"); 
    69     state(ac, 0, 0, 0, 1, 1); 
     66    state(ac, 0, 0, 1); 
    7067}); 
    7168 
    7269test("activate, jQuery or DOM element", function() { 
    73     var ac = $('#list1').accordion({ active: $("#list1 h3:last") }); 
    74     state(ac, 0, 0, 0, 1, 1); 
    75     ac.activate($("#list1 h3:first")); 
    76     state(ac, 1, 0, 0, 0, 0); 
    77     ac.activate($("#list1 h3")[1]); 
    78     state(ac, 0, 1, 1, 0, 0); 
     70    var ac = $('#list1').accordion({ active: $("#list1 a:last") }); 
     71    state(ac, 0, 0, 1); 
     72    ac.activate($("#list1 a:first")); 
     73    state(ac, 1, 0, 0); 
     74    ac.activate($("#list1 a")[1]); 
     75    state(ac, 0, 1, 0); 
    7976});