import { ObErrorMessagesService } from './error-messages.service' ; describe ( 'ErrorMessagesService' , ( ) => { let service ; let controlMock ; let result ; beforeEach ( ( ) => { service = new ObErrorMessagesService ( ) ; controlMock = { errors : { bar : { limit : 1 } , fuu : { valid : false } } } ; result = service . createMessages ( controlMock , false ) ; } ) ; it ( 'should add the `i18n.validation.` prefix to the key' , ( ) => { expect ( result [ 0 ] . key ) . toBe ( 'i18n.validation.bar' ) ; expect ( result [ 1 ] . key ) . toBe ( 'i18n.validation.fuu' ) ; } ) ; it ( 'should keep the params if they are provided' , ( ) => { expect ( result [ 0 ] . params ) . toBe ( controlMock . errors . bar ) ; } ) ; } ) ;