mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-11 18:13:47 +00:00
Added test for migrateDeprecatedSettings function
This commit is contained in:
31
test/settings/helpers/index.test.ts
Normal file
31
test/settings/helpers/index.test.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
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',
|
||||
},
|
||||
}),
|
||||
}));
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user