import { SavedObjectUnsanitizedDoc } from 'opensearch-dashboards/server' ; import { migrations } from './migrations' ; describe ( 'ui_settings 7.9.0 migrations' , ( ) => { const migration = migrations [ '7.9.0' ] ; test ( 'returns doc on empty object' , ( ) => { expect ( migration ( { } as SavedObjectUnsanitizedDoc ) ) . toEqual ( { references : [ ] , } ) ; } ) ; test ( 'properly renames siem attributes to securitySolution' , ( ) => { const doc = { type : 'config' , id : '8.0.0' , attributes : { buildNum : 9007199254740991 , 'siem:defaultAnomalyScore' : 59 , 'siem:enableNewsFeed' : false , } , references : [ ] , updated_at : '2020-06-09T20:18:20.349Z' , migrationVersion : { } , } ; expect ( migration ( doc ) ) . toEqual ( { type : 'config' , id : '8.0.0' , attributes : { buildNum : 9007199254740991 , 'securitySolution:defaultAnomalyScore' : 59 , 'securitySolution:enableNewsFeed' : false , } , references : [ ] , updated_at : '2020-06-09T20:18:20.349Z' , migrationVersion : { } , } ) ; } ) ; } ) ;