2018-05-08 19:48:17 +00:00
|
|
|
import { createStubMap } from './stubs';
|
2017-07-28 17:32:46 +00:00
|
|
|
import createUserSettings from '../../src/userSettings';
|
2017-02-28 17:08:38 +00:00
|
|
|
|
|
|
|
QUnit.module( 'ext.popups/userSettings', {
|
2018-03-14 22:04:59 +00:00
|
|
|
beforeEach() {
|
2017-02-28 17:08:38 +00:00
|
|
|
this.storage = createStubMap();
|
2018-05-08 19:48:17 +00:00
|
|
|
this.userSettings = createUserSettings( this.storage );
|
2017-02-28 17:08:38 +00:00
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
2021-03-31 08:51:54 +00:00
|
|
|
QUnit.test( '#isPagePreviewsEnabled should return false if Page Previews have been disabled', function ( assert ) {
|
2023-10-19 21:12:09 +00:00
|
|
|
this.userSettings.storePreviewTypeEnabled( 'page', false );
|
2017-02-28 17:08:38 +00:00
|
|
|
|
2022-02-09 15:09:19 +00:00
|
|
|
assert.false(
|
2023-10-19 21:12:09 +00:00
|
|
|
this.userSettings.isPreviewTypeEnabled( 'page' ),
|
2018-05-08 19:48:17 +00:00
|
|
|
'The user has disabled Page Previews.'
|
|
|
|
);
|
2017-02-28 17:08:38 +00:00
|
|
|
|
|
|
|
// ---
|
|
|
|
|
2023-10-19 21:12:09 +00:00
|
|
|
this.userSettings.storePreviewTypeEnabled( 'page', true );
|
2017-02-28 17:08:38 +00:00
|
|
|
|
2022-02-09 15:09:19 +00:00
|
|
|
assert.true(
|
2023-10-19 21:12:09 +00:00
|
|
|
this.userSettings.isPreviewTypeEnabled( 'page' ),
|
2021-03-31 08:51:54 +00:00
|
|
|
'#isPagePreviewsEnabled should return true if Page Previews have been enabled'
|
2017-02-28 17:08:38 +00:00
|
|
|
);
|
|
|
|
} );
|