import { getDefaultOption , getOptions , } from 'container/Header/DateTimeSelection/config' ; const CheckRouteDefaultGlobalTimeOptions = ( { route , } ) : void => { cy . visit ( Cypress . env ( 'baseUrl' ) + route ) ; const allOptions = getOptions ( route ) ; const defaultValue = getDefaultOption ( route ) ; const defaultSelectedOption = allOptions . find ( ( e ) => e . value === defaultValue ) ; expect ( defaultSelectedOption ) . not . undefined ; cy . findAllByTestId ( 'dropDown' ) . find ( 'span' ) . then ( ( el ) => { const elements = el . get ( ) ; const item = elements [ 1 ] ; expect ( defaultSelectedOption ?. label ) . to . be . equals ( item . innerText , 'Default option is not matching' ) ; } ) ; } ; export interface CheckRouteDefaultGlobalTimeOptionsProps { route : string ; } export default CheckRouteDefaultGlobalTimeOptions ;