import { FIELD_PREFIX_TO_ADD_AS_CANDIDATE } from '../constants' ; import { hasPrefixToInclude } from './has_prefix_to_include' ; describe ( 'aggregation utils' , ( ) => { describe ( 'hasPrefixToInclude' , ( ) => { it ( 'returns true if the prefix is included' , async ( ) => { FIELD_PREFIX_TO_ADD_AS_CANDIDATE . forEach ( ( prefix ) => { expect ( hasPrefixToInclude ( `${ prefix }the-field-name` ) ) . toBe ( true ) ; } ) ; } ) ; it ( 'returns false if the prefix is included' , async ( ) => { FIELD_PREFIX_TO_ADD_AS_CANDIDATE . forEach ( ( prefix ) => { expect ( hasPrefixToInclude ( `unknown-prefix-.${ prefix }the-field-name` ) ) . toBe ( false ) ; expect ( hasPrefixToInclude ( 'the-field-name' ) ) . toBe ( false ) ; } ) ; } ) ; } ) ; } ) ;