
* [MM-36058] Added config migration function, update default tray icon theme to system, allow Windows users to override icon theme * [MM-40572] Restore minimize to tray option for Windows * Lint fix * Test fix * Oops
39 lines
1.2 KiB
JavaScript
39 lines
1.2 KiB
JavaScript
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import JsonFileManager from 'common/JsonFileManager';
|
|
|
|
import migrateConfigItems from './migrationPreferences';
|
|
|
|
jest.mock('common/JsonFileManager', () => jest.fn());
|
|
|
|
describe('common/config/migrationPreferences', () => {
|
|
describe('migrateConfigItems', () => {
|
|
afterEach(() => {
|
|
jest.resetAllMocks();
|
|
});
|
|
|
|
it('should not migrate if all items migrated', () => {
|
|
JsonFileManager.mockImplementation(() => ({
|
|
getValue: () => true,
|
|
}));
|
|
expect(migrateConfigItems({})).toBe(false);
|
|
});
|
|
|
|
it('should migrate if items are not migrated', () => {
|
|
const originalPlatform = process.platform;
|
|
Object.defineProperty(process, 'platform', {
|
|
value: 'win32',
|
|
});
|
|
JsonFileManager.mockImplementation(() => ({
|
|
getValue: () => false,
|
|
setValue: jest.fn(),
|
|
}));
|
|
expect(migrateConfigItems({})).toBe(true);
|
|
Object.defineProperty(process, 'platform', {
|
|
value: originalPlatform,
|
|
});
|
|
});
|
|
});
|
|
});
|