mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-12-04 03:58:41 +00:00
b218a77ca4
The extension is out of beta and will be enabled by default now. Leaving some hints if we decide to also remove the feature flag. Bug: T282999 Bug: T351708 Change-Id: I1556b2f3592294d094770ede2c276eddeef8bbe9
56 lines
1.3 KiB
JavaScript
56 lines
1.3 KiB
JavaScript
import setUserConfigFlags from '../../src/setUserConfigFlags';
|
|
|
|
QUnit.module( 'ext.popups#setUserConfigFlags' );
|
|
|
|
QUnit.test( 'config settings are successfully set from bitmask', ( assert ) => {
|
|
const config = new Map();
|
|
|
|
config.set( 'wgPopupsFlags', '7' );
|
|
setUserConfigFlags( config );
|
|
|
|
assert.deepEqual(
|
|
[
|
|
config.get( 'wgPopupsConflictsWithNavPopupGadget' ),
|
|
config.get( 'wgPopupsConflictsWithRefTooltipsGadget' ),
|
|
config.get( 'wgPopupsReferencePreviews' )
|
|
],
|
|
[ true, true, true ]
|
|
);
|
|
|
|
config.set( 'wgPopupsFlags', '2' );
|
|
setUserConfigFlags( config );
|
|
|
|
assert.deepEqual(
|
|
[
|
|
config.get( 'wgPopupsConflictsWithNavPopupGadget' ),
|
|
config.get( 'wgPopupsConflictsWithRefTooltipsGadget' ),
|
|
config.get( 'wgPopupsReferencePreviews' )
|
|
],
|
|
[ false, true, false ]
|
|
);
|
|
|
|
config.set( 'wgPopupsFlags', '5' );
|
|
setUserConfigFlags( config );
|
|
|
|
assert.deepEqual(
|
|
[
|
|
config.get( 'wgPopupsConflictsWithNavPopupGadget' ),
|
|
config.get( 'wgPopupsConflictsWithRefTooltipsGadget' ),
|
|
config.get( 'wgPopupsReferencePreviews' )
|
|
],
|
|
[ true, false, true ]
|
|
);
|
|
|
|
config.set( 'wgPopupsFlags', '0' );
|
|
setUserConfigFlags( config );
|
|
|
|
assert.deepEqual(
|
|
[
|
|
config.get( 'wgPopupsConflictsWithNavPopupGadget' ),
|
|
config.get( 'wgPopupsConflictsWithRefTooltipsGadget' ),
|
|
config.get( 'wgPopupsReferencePreviews' )
|
|
],
|
|
[ false, false, false ]
|
|
);
|
|
} );
|