import type { EncryptedSavedObjectsPluginSetup , EncryptedSavedObjectsPluginStart } from './plugin' ; import type { EncryptedSavedObjectsClient , EncryptedSavedObjectsClientOptions , } from './saved_objects' ; function createEncryptedSavedObjectsSetupMock ( { canEncrypt } = { canEncrypt : false } ) { return { registerType : jest . fn ( ) , __legacyCompat : { registerLegacyAPI : jest . fn ( ) } , canEncrypt , createMigration : jest . fn ( ) , } as jest . Mocked < EncryptedSavedObjectsPluginSetup > ; } function createEncryptedSavedObjectsStartMock ( ) { return { isEncryptionError : jest . fn ( ) , getClient : jest . fn ( ( opts ) => createEncryptedSavedObjectsClienttMock ( opts ) ) , } as jest . Mocked < EncryptedSavedObjectsPluginStart > ; } function createEncryptedSavedObjectsClienttMock ( opts ? ) { return { getDecryptedAsInternalUser : jest . fn ( ) , } as jest . Mocked < EncryptedSavedObjectsClient > ; } export const encryptedSavedObjectsMock = { createSetup : createEncryptedSavedObjectsSetupMock , createStart : createEncryptedSavedObjectsStartMock , createClient : createEncryptedSavedObjectsClienttMock , } ;