mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-27 17:00:37 +00:00
59c6b8e88f
* Adds a new webpack entry point for references previews * Reference related code in src/index.js is moved to new file resources/ext.popups.referencePreviews/index.js The changes: * References previews now in its own module ext.popups.referencePreviews * Loaded via getCustomPopupTypes * OWNERS.md files make clear which team owns which part of the code. Bug: T326692 Change-Id: Iea8a5b9221c0b1fd41e40bff2cbe01e42124d53f
48 lines
901 B
JavaScript
48 lines
901 B
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' )
|
|
],
|
|
[ true ]
|
|
);
|
|
|
|
config.set( 'wgPopupsFlags', '2' );
|
|
setUserConfigFlags( config );
|
|
|
|
assert.deepEqual(
|
|
[
|
|
config.get( 'wgPopupsConflictsWithNavPopupGadget' )
|
|
],
|
|
[ false ]
|
|
);
|
|
|
|
config.set( 'wgPopupsFlags', '5' );
|
|
setUserConfigFlags( config );
|
|
|
|
assert.deepEqual(
|
|
[
|
|
config.get( 'wgPopupsConflictsWithNavPopupGadget' )
|
|
],
|
|
[ true ]
|
|
);
|
|
|
|
config.set( 'wgPopupsFlags', '0' );
|
|
setUserConfigFlags( config );
|
|
|
|
assert.deepEqual(
|
|
[
|
|
config.get( 'wgPopupsConflictsWithNavPopupGadget' )
|
|
],
|
|
[ false ]
|
|
);
|
|
} );
|