2021-03-11 10:32:30 +00:00
|
|
|
import setUserConfigFlags from '../../src/setUserConfigFlags';
|
|
|
|
|
2021-04-16 11:23:10 +00:00
|
|
|
QUnit.module( 'ext.popups#setUserConfigFlags' );
|
|
|
|
|
2021-03-11 10:32:30 +00:00
|
|
|
QUnit.test( 'config settings are successfully set from bitmask', ( assert ) => {
|
|
|
|
const config = new Map();
|
|
|
|
|
2023-11-06 08:48:29 +00:00
|
|
|
config.set( 'wgPopupsFlags', '7' );
|
2021-03-11 10:32:30 +00:00
|
|
|
setUserConfigFlags( config );
|
|
|
|
|
|
|
|
assert.deepEqual(
|
|
|
|
[
|
2024-01-03 01:00:34 +00:00
|
|
|
config.get( 'wgPopupsConflictsWithNavPopupGadget' )
|
2021-03-11 10:32:30 +00:00
|
|
|
],
|
2024-01-03 01:00:34 +00:00
|
|
|
[ true ]
|
2021-03-11 10:32:30 +00:00
|
|
|
);
|
|
|
|
|
2023-11-06 08:48:29 +00:00
|
|
|
config.set( 'wgPopupsFlags', '2' );
|
2021-03-11 10:32:30 +00:00
|
|
|
setUserConfigFlags( config );
|
|
|
|
|
|
|
|
assert.deepEqual(
|
|
|
|
[
|
2024-01-03 01:00:34 +00:00
|
|
|
config.get( 'wgPopupsConflictsWithNavPopupGadget' )
|
2021-03-11 10:32:30 +00:00
|
|
|
],
|
2024-01-03 01:00:34 +00:00
|
|
|
[ false ]
|
2021-03-11 10:32:30 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
config.set( 'wgPopupsFlags', '5' );
|
|
|
|
setUserConfigFlags( config );
|
|
|
|
|
|
|
|
assert.deepEqual(
|
|
|
|
[
|
2024-01-03 01:00:34 +00:00
|
|
|
config.get( 'wgPopupsConflictsWithNavPopupGadget' )
|
2021-03-11 10:32:30 +00:00
|
|
|
],
|
2024-01-03 01:00:34 +00:00
|
|
|
[ true ]
|
2021-03-11 10:32:30 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
config.set( 'wgPopupsFlags', '0' );
|
|
|
|
setUserConfigFlags( config );
|
|
|
|
|
|
|
|
assert.deepEqual(
|
|
|
|
[
|
2024-01-03 01:00:34 +00:00
|
|
|
config.get( 'wgPopupsConflictsWithNavPopupGadget' )
|
2021-03-11 10:32:30 +00:00
|
|
|
],
|
2024-01-03 01:00:34 +00:00
|
|
|
[ false ]
|
2021-03-11 10:32:30 +00:00
|
|
|
);
|
|
|
|
} );
|