From: MatmaRex Date: Sun, 21 Jul 2013 11:52:47 +0000 (+0200) Subject: jquery.makeCollapsible: Consistency in test names X-Git-Tag: 1.31.0-rc.0~19031^2~1 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=1fd1c5bb6ad2686b1630a5a70f3d79d32658c1cc;p=lhc%2Fweb%2Fwiklou.git jquery.makeCollapsible: Consistency in test names Mention which part of the code is being tested in parentheses in test names. Some actions can be triggered inmore than one way or in more than one context: this gives a clearer image of what has tests already and what hasn't. Change-Id: I48dcf831f6a622f08061b29ca90fb0614e4cbab6 --- diff --git a/tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js b/tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js index 38063e6838..cc2e0672cd 100644 --- a/tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js @@ -10,7 +10,8 @@ .makeCollapsible( options ); } - QUnit.asyncTest( 'testing hooks (triggers)', 4, function ( assert ) { + // This test is first because if it fails, then almost all of the latter tests are meaningless. + QUnit.asyncTest( 'testing hooks/triggers', 4, function ( assert ) { var $collapsible, $content, $toggle; $collapsible = prepareCollapsible( '
' + loremIpsum + '
' @@ -45,7 +46,7 @@ $toggle.trigger( 'click' ); } ); - QUnit.asyncTest( 'basic operation', 3, function ( assert ) { + QUnit.asyncTest( 'basic operation (
)', 3, function ( assert ) { var $collapsible, $content; $collapsible = prepareCollapsible( '
' + loremIpsum + '
' @@ -63,7 +64,7 @@ $collapsible.find( '.mw-collapsible-toggle' ).trigger( 'click' ); } ); - QUnit.test( 'basic operation with instantHide (synchronous test)', 2, function ( assert ) { + QUnit.test( 'basic operation when synchronous (options.instantHide)', 2, function ( assert ) { var $collapsible, $content; $collapsible = prepareCollapsible( '
' + loremIpsum + '
', @@ -78,7 +79,7 @@ assert.assertTrue( $content.is( ':hidden' ), 'after collapsing: content is hidden' ); } ); - QUnit.asyncTest( 'initially collapsed - mw-collapsed class', 2, function ( assert ) { + QUnit.asyncTest( 'initial collapse (mw-collapsed class)', 2, function ( assert ) { var $collapsible, $content; $collapsible = prepareCollapsible( '
' + loremIpsum + '
' @@ -96,7 +97,7 @@ $collapsible.find( '.mw-collapsible-toggle' ).trigger( 'click' ); } ); - QUnit.asyncTest( 'initially collapsed - options', 2, function ( assert ) { + QUnit.asyncTest( 'initial collapse (options.collapsed)', 2, function ( assert ) { var $collapsible, $content; $collapsible = prepareCollapsible( '
' + loremIpsum + '
', @@ -115,7 +116,7 @@ $collapsible.find( '.mw-collapsible-toggle' ).trigger( 'click' ); } ); - QUnit.test( 'premade toggler - options.linksPassthru' , 2, function ( assert ) { + QUnit.test( 'clicks on links inside toggler pass through (options.linksPassthru)' , 2, function ( assert ) { var $collapsible, $content; $collapsible = prepareCollapsible(