Bug Tracker

Show
Ignore:
Timestamp:
02/10/08 15:02:03 (10 months ago)
Author:
joern.zaefferer
Message:

updated change event to 1.5 callback API

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

Legend:

Unmodified
Added
Removed
  • trunk/plugins/accordion/test/test.js

    r4523 r4707  
    1313 
    1414test("autoheight", function() { 
    15     $('#navigation').makeAccordion({ header: '.head', autoheight: false }); 
     15    $('#navigation').accordion({ header: '.head', autoheight: false }); 
    1616    equals( 90, $('#navigation ul:first').height() ); 
    1717    equals( 126, $('#navigation ul:eq(1)').height() ); 
    1818    equals( 54, $('#navigation ul:last').height() ); 
    19     $('#navigation').removeAccordion().makeAccordion({ header: '.head',autoheight: true }); 
     19    $('#navigation').accordion("destroy").accordion({ header: '.head',autoheight: true }); 
    2020    equals( 126, $('#navigation ul:first').height() ); 
    2121    equals( 126, $('#navigation ul:eq(1)').height() ); 
     
    2424 
    2525test("activate, numeric", function() { 
    26     var ac = $('#list1').makeAccordion({ active: 1 }); 
     26    var ac = $('#list1').accordion({ active: 1 }); 
    2727    state(ac, 0, 1, 0); 
    28     ac.activate(2); 
     28    ac.accordion("activate", 2); 
    2929    state(ac, 0, 0, 1); 
    30     ac.activate(0); 
     30    ac.accordion("activate", 0); 
    3131    state(ac, 1, 0, 0); 
    32     ac.activate(1); 
     32    ac.accordion("activate", 1); 
    3333    state(ac, 0, 1, 0); 
    34     ac.activate(2); 
     34    ac.accordion("activate", 2); 
    3535    state(ac, 0, 0, 1); 
    36     ac.activate(-1); 
     36    ac.accordion("activate", -1); 
    3737    state(ac, 0, 0, 1); 
    3838}); 
    3939 
    4040test("activate, boolean and numeric, alwaysOpen:false", function() { 
    41     var ac = $('#list1').makeAccordion({alwaysOpen: false}).activate(2); 
     41    var ac = $('#list1').accordion({alwaysOpen: false}).accordion("activate", 2); 
    4242    state(ac, 0, 0, 1); 
    4343    ok("x", "----") 
    44     ac.activate(0); 
     44    ac.accordion("activate", 0); 
    4545    state(ac, 1, 0, 0); 
    4646    ok("x", "----") 
    47     ac.activate(-1); 
     47    ac.accordion("activate", -1); 
    4848    state(ac, 0, 0, 0); 
    4949}); 
    5050 
    5151test("activate, boolean, alwaysOpen:true", function() { 
    52     var ac = $('#list1').makeAccordion().activate(2); 
     52    var ac = $('#list1').accordion().accordion("activate", 2); 
    5353    state(ac, 0, 0, 1); 
    54     ac.activate(-1); 
     54    ac.accordion("activate", -1); 
    5555    state(ac, 0, 0, 1); 
    5656}); 
    5757 
    5858test("activate, string expression", function() { 
    59     var ac = $('#list1').makeAccordion({ active: ":last" }); 
     59    var ac = $('#list1').accordion({ active: ":last" }); 
    6060    state(ac, 0, 0, 1); 
    61     ac.activate(":first"); 
     61    ac.accordion("activate", ":first"); 
    6262    state(ac, 1, 0, 0); 
    63     ac.activate(":eq(1)"); 
     63    ac.accordion("activate", ":eq(1)"); 
    6464    state(ac, 0, 1, 0); 
    65     ac.activate(":last"); 
     65    ac.accordion("activate", ":last"); 
    6666    state(ac, 0, 0, 1); 
    6767}); 
    6868 
    6969test("activate, jQuery or DOM element", function() { 
    70     var ac = $('#list1').makeAccordion({ active: $("#list1 a:last") }); 
     70    var ac = $('#list1').accordion({ active: $("#list1 a:last") }); 
    7171    state(ac, 0, 0, 1); 
    72     ac.activate($("#list1 a:first")); 
     72    ac.accordion("activate", $("#list1 a:first")); 
    7373    state(ac, 1, 0, 0); 
    74     ac.activate($("#list1 a")[1]); 
     74    ac.accordion("activate", $("#list1 a")[1]); 
    7575    state(ac, 0, 1, 0); 
    7676}); 
  • trunk/plugins/accordion/test/testrunner.js

    r2587 r4707  
    1414}; 
    1515 
     16var isLocal = !!(window.location.protocol == 'file:'); 
     17 
    1618$(function() { 
    1719    $('#userAgent').html(navigator.userAgent); 
     
    4042        start(); 
    4143    }; 
    42     _config.timeout = setTimeout(handler, _config.asyncTimeout * 1000); 
     44    // Disabled, caused too many random errors 
     45    //_config.timeout = setTimeout(handler, _config.asyncTimeout * 1000); 
    4346} 
    4447function start() { 
    45     if(_config.timeout) 
    46         clearTimeout(_config.timeout); 
    47     _config.blocking = false; 
    48     process(); 
     48    // A slight delay, to avoid any current callbacks 
     49    setTimeout(function(){ 
     50        if(_config.timeout) 
     51            clearTimeout(_config.timeout); 
     52        _config.blocking = false; 
     53        process(); 
     54    }, 13); 
    4955} 
    5056 
     
    5359    var time = new Date(); 
    5460    _config.fixture = document.getElementById('main').innerHTML; 
    55     reset(); 
    5661    synchronize(function() { 
    5762        time = new Date() - time; 
     
    7075         
    7176    var filter = location.search.slice(1); 
    72     if ( filter && encodeURIComponent(name) != filter ) 
     77    if ( filter && encodeURIComponent(name).indexOf(filter) == -1 ) 
    7378        return; 
    7479         
     
    8489            } 
    8590            _config.Test.push( [ false, "Died on test #" + (_config.Test.length+1) + ": " + e ] ); 
    86             throw e; 
    8791        } 
    8892    }); 
     
    158162 */ 
    159163function reset() { 
    160     document.getElementById('main').innerHTML = _config.fixture; 
     164    $("#main").html( _config.fixture ); 
    161165} 
    162166