import type { DeprecationsServiceStart , DomainDeprecationDetails } from 'kibana/public' ; const kibanaDeprecations = [ { correctiveActions : { manualSteps : [ 'Step 1' ] , api : { method : 'POST' , path : '/test' , } , } , domainId : 'test_domain_1' , level : 'critical' , title : 'Test deprecation title 1' , message : 'Test deprecation message 1' , deprecationType : 'config' , configPath : 'test' , } , { correctiveActions : { manualSteps : [ 'Step 1' , 'Step 2' , 'Step 3' ] , } , domainId : 'test_domain_2' , level : 'warning' , title : 'Test deprecation title 1' , documentationUrl : 'https://' , message : 'Test deprecation message 2' , deprecationType : 'feature' , } , { correctiveActions : { manualSteps : [ ] , } , domainId : 'test_domain_3' , level : 'warning' , title : 'Test deprecation title 3' , message : 'Test deprecation message 3' , deprecationType : 'feature' , } , ] ; const setLoadDeprecations = ( { deprecationService , response , mockRequestErrorMessage , } ) => { const mockResponse = response ? response : kibanaDeprecations ; if ( mockRequestErrorMessage ) { return deprecationService . getAllDeprecations . mockRejectedValue ( new Error ( mockRequestErrorMessage ) ) ; } return deprecationService . getAllDeprecations . mockReturnValue ( Promise . resolve ( mockResponse ) ) ; } ; const setResolveDeprecations = ( { deprecationService , status , } ) => { if ( status === 'fail' ) { return deprecationService . resolveDeprecation . mockReturnValue ( Promise . resolve ( { status , reason : 'resolve failed' , } ) ) ; } return deprecationService . resolveDeprecation . mockReturnValue ( Promise . resolve ( { status , } ) ) ; } ; export const kibanaDeprecationsServiceHelpers = { setLoadDeprecations , setResolveDeprecations , defaultMockedResponses : { mockedKibanaDeprecations : kibanaDeprecations , mockedCriticalKibanaDeprecations : kibanaDeprecations . filter ( ( deprecation ) => deprecation . level === 'critical' ) , mockedWarningKibanaDeprecations : kibanaDeprecations . filter ( ( deprecation ) => deprecation . level === 'warning' ) , mockedConfigKibanaDeprecations : kibanaDeprecations . filter ( ( deprecation ) => deprecation . deprecationType === 'config' ) , } , } ;