import { DATA_FORMATTERS } from '../../../../common/enums' ; import { getFormatterType } from './get_formatter_type' ; describe ( 'getFormatterType(formatter)' , ( ) => { it ( 'should return bytes formatter for "bytes"' , ( ) => { const actual = getFormatterType ( DATA_FORMATTERS . BYTES ) ; expect ( actual ) . toBe ( DATA_FORMATTERS . BYTES ) ; } ) ; it ( 'should return duration formatter for duration format string' , ( ) => { const actual = getFormatterType ( 'ns,ms,2' ) ; expect ( actual ) . toBe ( DATA_FORMATTERS . DURATION ) ; } ) ; it ( 'should return custom formatter for Numeral.js pattern' , ( ) => { const actual = getFormatterType ( '$ 0.00' ) ; expect ( actual ) . toBe ( DATA_FORMATTERS . CUSTOM ) ; } ) ; } ) ;