* 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
mw.user.getGroups( function ( groups ) {
// First group should always be '*'
assert.equal( $.type( groups ), 'array', 'Callback gets an array' );
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' );
// 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' );