From 1fd1c5bb6ad2686b1630a5a70f3d79d32658c1cc Mon Sep 17 00:00:00 2001 From: MatmaRex Date: Sun, 21 Jul 2013 13:52:47 +0200 Subject: [PATCH] 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 --- .../resources/jquery/jquery.makeCollapsible.test.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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( -- 2.20.1