import React from 'react' ; import { UrlParams } from './types' ; import { UrlParamsContext } from './url_params_context' ; const defaultUrlParams = { page : 0 , serviceName : 'opbeans-python' , transactionType : 'request' , start : '2018-01-10T09:51:41.050Z' , end : '2018-01-10T10:06:41.050Z' , } ; interface Props { params ? : UrlParams ; children : React . ReactNode ; refreshTimeRange ? : ( time : any ) => void ; } export function MockUrlParamsContextProvider ( { params , children , refreshTimeRange = ( ) => undefined , } ) { const urlParams = { ... defaultUrlParams , ... params } ; return ( < UrlParamsContext . Provider value = { { rangeId : 0 , refreshTimeRange , urlParams , uxUiFilters : { } , } } children = { children } / > ) ; }