import { ServiceProvider } from '../../common/types' ; const DEFAULT_SP_DESCRIPTION = 'par défaut' ; export const getServiceProviderByDescription = ( serviceProviders , description ) : ServiceProvider => { const serviceProvider = serviceProviders . find ( ( serviceProvider ) => serviceProvider . descriptions . includes ( description ) ) ; expect ( serviceProvider , `No service provider matches the description '${ description }'` ) . to . exist ; cy . wrap ( serviceProvider ) . as ( 'serviceProvider' ) ; return serviceProvider ; } ; export const getDefaultServiceProvider = ( serviceProviders ) : ServiceProvider => getServiceProviderByDescription ( serviceProviders , DEFAULT_SP_DESCRIPTION ) ;