From: Timo Tijhof Date: Sun, 2 Sep 2012 19:43:08 +0000 (+0200) Subject: mediawiki.user.test: Fix getGroups() regression X-Git-Tag: 1.31.0-rc.0~22483^2 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=251a532c1f10b5d35d31a981b9ee97da1230792e;p=lhc%2Fweb%2Fwiklou.git mediawiki.user.test: Fix getGroups() regression * Test depended on sort order, fixing by looking up index instead. Order is not documented and should not be depended on, therefore updating the test instead of changing the output. * Follows-up 1e8992ca7489e620d157d9a50d9aa5e611b84887 Change-Id: Id72b0550e5c0e1ae5454005f9245d1d542fc2e46 --- diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js index c823bafd9c..16c97dff63 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js @@ -37,7 +37,7 @@ QUnit.asyncTest( 'getGroups', 3, function ( assert ) { mw.user.getGroups( function ( groups ) { // First group should always be '*' assert.equal( $.type( groups ), 'array', 'Callback gets an array' ); - assert.equal( groups[0], '*', '"*"" is the first group' ); + assert.notStrictEqual( $.inArray( '*', groups ), -1, '"*"" is in the list' ); // Sort needed because of different methods if creating the arrays, // only the content matters. assert.deepEqual( groups.sort(), mw.config.get( 'wgUserGroups' ).sort(), 'Array contains all groups, just like wgUserGroups' );