parent
a5be04d17b
commit
67ecc2051a
1 changed files with 33 additions and 0 deletions
|
@ -45,6 +45,39 @@ describe('ui_settings 7.9.0 migrations', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('ui_settings 7.12.0 migrations', () => {
|
||||
const migration = migrations['7.12.0'];
|
||||
|
||||
test('returns doc on empty object', () => {
|
||||
expect(migration({} as SavedObjectUnsanitizedDoc)).toEqual({
|
||||
references: [],
|
||||
});
|
||||
});
|
||||
test('properly migrates timepicker:quickRanges', () => {
|
||||
const initialQuickRange: any = {
|
||||
from: '123',
|
||||
to: '321',
|
||||
display: 'abc',
|
||||
section: 2,
|
||||
};
|
||||
const { section, ...migratedQuickRange } = initialQuickRange;
|
||||
|
||||
const doc = {
|
||||
type: 'config',
|
||||
id: '8.0.0',
|
||||
attributes: {
|
||||
buildNum: 9007199254740991,
|
||||
'timepicker:quickRanges': JSON.stringify([initialQuickRange]),
|
||||
},
|
||||
references: [],
|
||||
updated_at: '2020-06-09T20:18:20.349Z',
|
||||
migrationVersion: {},
|
||||
};
|
||||
const migrated = migration(doc);
|
||||
expect(JSON.parse(migrated.attributes['timepicker:quickRanges'])).toEqual([migratedQuickRange]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('ui_settings 7.13.0 migrations', () => {
|
||||
const migration = migrations['7.13.0'];
|
||||
|
||||
|
|
Loading…
Reference in a new issue