TheDJ has submitted this change and it was merged.

Change subject: jquery.makeCollapsible: Some low-level tests
......................................................................


jquery.makeCollapsible: Some low-level tests

* mw-made-collapsible data added
* mw-collapsible added when missing
* mw-collapsed added when missing

Change-Id: If88c57403464aca053c7babfad8802742640fcfa
---
M tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js
1 file changed, 25 insertions(+), 0 deletions(-)

Approvals:
  TheDJ: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js 
b/tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js
index cc2e067..468e74c 100644
--- a/tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js
+++ b/tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js
@@ -79,6 +79,31 @@
                assert.assertTrue( $content.is( ':hidden' ), 'after collapsing: 
content is hidden' );
        } );
 
+       QUnit.test( 'mw-made-collapsible data added', 1, function ( assert ) {
+               var $collapsible;
+               $collapsible = prepareCollapsible(
+                       '<div>' + loremIpsum + '</div>'
+               );
+               assert.equal( $collapsible.data( 'mw-made-collapsible' ), true, 
'mw-made-collapsible data present' );
+       } );
+
+       QUnit.test( 'mw-collapsible added when missing', 1, function ( assert ) 
{
+               var $collapsible;
+               $collapsible = prepareCollapsible(
+                       '<div>' + loremIpsum + '</div>'
+               );
+               assert.assertTrue( $collapsible.hasClass( 'mw-collapsible' ), 
'mw-collapsible class present' );
+       } );
+
+       QUnit.test( 'mw-collapsed added when missing', 1, function ( assert ) {
+               var $collapsible;
+               $collapsible = prepareCollapsible(
+                       '<div>' + loremIpsum + '</div>',
+                       { collapsed: true }
+               );
+               assert.assertTrue( $collapsible.hasClass( 'mw-collapsed' ), 
'mw-collapsed class present' );
+       } );
+
        QUnit.asyncTest( 'initial collapse (mw-collapsed class)', 2, function ( 
assert ) {
                var $collapsible, $content;
                $collapsible = prepareCollapsible(

-- 
To view, visit https://gerrit.wikimedia.org/r/74965
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If88c57403464aca053c7babfad8802742640fcfa
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Matmarex <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: TheDJ <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to