mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 17:40:23 +03:00
32 lines
845 B
TypeScript
32 lines
845 B
TypeScript
|
import { Mock } from 'ts-mockery';
|
||
|
import { migrateDeprecatedSettings } from '../../../src/settings/helpers';
|
||
|
import { ShlinkState } from '../../../src/container/types';
|
||
|
|
||
|
describe('settings-helpers', () => {
|
||
|
describe('migrateDeprecatedSettings', () => {
|
||
|
it('updates settings as expected', () => {
|
||
|
const state = Mock.of<ShlinkState>({
|
||
|
settings: {
|
||
|
visits: {
|
||
|
defaultInterval: 'last180days' as any,
|
||
|
},
|
||
|
ui: {
|
||
|
tagsMode: 'list',
|
||
|
} as any,
|
||
|
},
|
||
|
});
|
||
|
|
||
|
expect(migrateDeprecatedSettings(state)).toEqual(expect.objectContaining({
|
||
|
settings: expect.objectContaining({
|
||
|
visits: {
|
||
|
defaultInterval: 'last180Days',
|
||
|
},
|
||
|
tags: {
|
||
|
defaultMode: 'list',
|
||
|
},
|
||
|
}),
|
||
|
}));
|
||
|
});
|
||
|
});
|
||
|
});
|