Changeset 4707 for trunk/plugins/accordion/test
- Timestamp:
- 02/10/08 15:02:03 (10 months ago)
- Location:
- trunk/plugins/accordion/test
- Files:
-
- 2 modified
-
test.js (modified) (2 diffs)
-
testrunner.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/accordion/test/test.js
r4523 r4707 13 13 14 14 test("autoheight", function() { 15 $('#navigation'). makeAccordion({ header: '.head', autoheight: false });15 $('#navigation').accordion({ header: '.head', autoheight: false }); 16 16 equals( 90, $('#navigation ul:first').height() ); 17 17 equals( 126, $('#navigation ul:eq(1)').height() ); 18 18 equals( 54, $('#navigation ul:last').height() ); 19 $('#navigation'). removeAccordion().makeAccordion({ header: '.head',autoheight: true });19 $('#navigation').accordion("destroy").accordion({ header: '.head',autoheight: true }); 20 20 equals( 126, $('#navigation ul:first').height() ); 21 21 equals( 126, $('#navigation ul:eq(1)').height() ); … … 24 24 25 25 test("activate, numeric", function() { 26 var ac = $('#list1'). makeAccordion({ active: 1 });26 var ac = $('#list1').accordion({ active: 1 }); 27 27 state(ac, 0, 1, 0); 28 ac.ac tivate(2);28 ac.accordion("activate", 2); 29 29 state(ac, 0, 0, 1); 30 ac.ac tivate(0);30 ac.accordion("activate", 0); 31 31 state(ac, 1, 0, 0); 32 ac.ac tivate(1);32 ac.accordion("activate", 1); 33 33 state(ac, 0, 1, 0); 34 ac.ac tivate(2);34 ac.accordion("activate", 2); 35 35 state(ac, 0, 0, 1); 36 ac.ac tivate(-1);36 ac.accordion("activate", -1); 37 37 state(ac, 0, 0, 1); 38 38 }); 39 39 40 40 test("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); 42 42 state(ac, 0, 0, 1); 43 43 ok("x", "----") 44 ac.ac tivate(0);44 ac.accordion("activate", 0); 45 45 state(ac, 1, 0, 0); 46 46 ok("x", "----") 47 ac.ac tivate(-1);47 ac.accordion("activate", -1); 48 48 state(ac, 0, 0, 0); 49 49 }); 50 50 51 51 test("activate, boolean, alwaysOpen:true", function() { 52 var ac = $('#list1'). makeAccordion().activate(2);52 var ac = $('#list1').accordion().accordion("activate", 2); 53 53 state(ac, 0, 0, 1); 54 ac.ac tivate(-1);54 ac.accordion("activate", -1); 55 55 state(ac, 0, 0, 1); 56 56 }); 57 57 58 58 test("activate, string expression", function() { 59 var ac = $('#list1'). makeAccordion({ active: ":last" });59 var ac = $('#list1').accordion({ active: ":last" }); 60 60 state(ac, 0, 0, 1); 61 ac.ac tivate(":first");61 ac.accordion("activate", ":first"); 62 62 state(ac, 1, 0, 0); 63 ac.ac tivate(":eq(1)");63 ac.accordion("activate", ":eq(1)"); 64 64 state(ac, 0, 1, 0); 65 ac.ac tivate(":last");65 ac.accordion("activate", ":last"); 66 66 state(ac, 0, 0, 1); 67 67 }); 68 68 69 69 test("activate, jQuery or DOM element", function() { 70 var ac = $('#list1'). makeAccordion({ active: $("#list1 a:last") });70 var ac = $('#list1').accordion({ active: $("#list1 a:last") }); 71 71 state(ac, 0, 0, 1); 72 ac.ac tivate($("#list1 a:first"));72 ac.accordion("activate", $("#list1 a:first")); 73 73 state(ac, 1, 0, 0); 74 ac.ac tivate($("#list1 a")[1]);74 ac.accordion("activate", $("#list1 a")[1]); 75 75 state(ac, 0, 1, 0); 76 76 }); -
trunk/plugins/accordion/test/testrunner.js
r2587 r4707 14 14 }; 15 15 16 var isLocal = !!(window.location.protocol == 'file:'); 17 16 18 $(function() { 17 19 $('#userAgent').html(navigator.userAgent); … … 40 42 start(); 41 43 }; 42 _config.timeout = setTimeout(handler, _config.asyncTimeout * 1000); 44 // Disabled, caused too many random errors 45 //_config.timeout = setTimeout(handler, _config.asyncTimeout * 1000); 43 46 } 44 47 function 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); 49 55 } 50 56 … … 53 59 var time = new Date(); 54 60 _config.fixture = document.getElementById('main').innerHTML; 55 reset();56 61 synchronize(function() { 57 62 time = new Date() - time; … … 70 75 71 76 var filter = location.search.slice(1); 72 if ( filter && encodeURIComponent(name) != filter)77 if ( filter && encodeURIComponent(name).indexOf(filter) == -1 ) 73 78 return; 74 79 … … 84 89 } 85 90 _config.Test.push( [ false, "Died on test #" + (_config.Test.length+1) + ": " + e ] ); 86 throw e;87 91 } 88 92 }); … … 158 162 */ 159 163 function reset() { 160 document.getElementById('main').innerHTML = _config.fixture;164 $("#main").html( _config.fixture ); 161 165 } 162 166
