I'm new to Q-unit so just currently testing it out with some basic jQuery UI. My problem is only one of my tests actually shows up and runs, so currently in my code I have 3 tests written but only one of them returns a pass/fail value. If I move that test to a different order relative to the others it is still the only one called. I'm guessing this could be something under hood in the way I'm calling my tests. Any Ideas?
$(document).ready(function(){
module("Accordion tests");
var $elementLast = $('h3:last');
var $lineLast = $('p:last');
var $lineSecond = $('p:eq(1)');
$elementLast.click();
test( "Correct Section becomes visable on click", function() {
ok( $lineLast.is(":visible") )
})
test( "Wrong Sections Don't become visable", function() {
notOk( $lineSecond.is(":visible") )
})
test( "Wrong Sections Don't become visable", function() {
equal( $lineSecond.is(":visible") )
})
});
Here is what the test output currently looks like:
Tests completed in 6 milliseconds. 1 assertions of 1 passed, 0 failed.
Accordion tests: Correct Section becomes visable on clickRerun
Accordion tests: Wrong Sections Don't become visable (1)Rerun2 ms okay@ 2 ms
Accordion tests: Wrong Sections Don't become visable Rerun
Aucun commentaire:
Enregistrer un commentaire