import { pickAcr } from './acr.transform' ; describe ( 'eIDAS transform' , ( ) => { const defaultValue = 'default_eidas_value' ; const resultMock = 'eidas2' ; const maximumValueMock = 'eidas3' ; const knownAcrValues = [ resultMock , maximumValueMock ] ; describe ( 'pickAcr' , ( ) => { it ( 'should return the minimum eIDAS value if value and config have common value' , ( ) => { const value = [ resultMock ] ; const result = pickAcr ( knownAcrValues , value , defaultValue ) ; expect ( result ) . toStrictEqual ( resultMock ) ; } ) ; it ( 'should return the minimum eIDAS value if values and config have common values' , ( ) => { const value = [ 'eidas2' , 'eidas3' ] ; const result = pickAcr ( knownAcrValues , value , defaultValue ) ; expect ( result ) . toStrictEqual ( resultMock ) ; } ) ; it ( 'should return the minimum eIDAS value if values and config have some common values' , ( ) => { const value = [ 'eidas2' , 'eidas3' , 'Harry' ] ; const result = pickAcr ( knownAcrValues , value , defaultValue ) ; expect ( result ) . toStrictEqual ( resultMock ) ; } ) ; it ( 'should return the default eIDAS value if values and config have not common values' , ( ) => { const value = [ 'Harry' , 'Hermione' , 'Ron' ] ; const result = pickAcr ( knownAcrValues , value , defaultValue ) ; expect ( result ) . toStrictEqual ( defaultValue ) ; } ) ; it ( 'should return the default eIDAS value if values are wrong and config is empty' , ( ) => { const value = [ 'Harry' , 'Hermione' , 'Ron' ] ; const result = pickAcr ( [ ] , value , defaultValue ) ; expect ( result ) . toStrictEqual ( defaultValue ) ; } ) ; } ) ; } ) ;