import type { SavedObjectMigrationContext , SavedObjectMigrationFn } from 'kibana/server' ; import { replaceIndexPatternReference } from './replace_index_pattern_reference' ; describe ( 'replaceIndexPatternReference' , ( ) => { const savedObjectMigrationContext = null as unknown as SavedObjectMigrationContext ; test ( 'should replace index_pattern to index-pattern' , ( ) => { const migratedDoc = replaceIndexPatternReference ( { references : [ { name : 'name' , type : 'index_pattern' , } , ] , } as Parameters < SavedObjectMigrationFn > [ 0 ] , savedObjectMigrationContext ) ; expect ( migratedDoc ) . toMatchInlineSnapshot ( `
      Object {
        "references": Array [
          Object {
            "name": "name",
            "type": "index-pattern",
          },
        ],
      }
    ` ) ; } ) ; } ) ;