import expect from '@kbn/expect' ; import { FtrProviderContext } from '../../ftr_provider_context' ; export default function ( { getService , getPageObjects } ) { const esArchiver = getService ( 'esArchiver' ) ; const toasts = getService ( 'toasts' ) ; const PageObjects = getPageObjects ( [ 'common' , 'discover' , 'timePicker' ] ) ; describe ( 'errors' , function describeIndexTests ( ) { before ( async function ( ) { await esArchiver . loadIfNeeded ( 'x-pack/test/functional/es_archives/logstash_functional' ) ; await esArchiver . load ( 'x-pack/test/functional/es_archives/invalid_scripted_field' ) ; await PageObjects . timePicker . setDefaultAbsoluteRangeViaUiSettings ( ) ; await PageObjects . common . navigateToApp ( 'discover' ) ; } ) ; after ( async function ( ) { await esArchiver . unload ( 'x-pack/test/functional/es_archives/invalid_scripted_field' ) ; } ) ; describe ( 'invalid scripted field error' , ( ) => { it ( 'is rendered' , async ( ) => { const toast = await toasts . getToastElement ( 1 ) ; const painlessStackTrace = await toast . findByTestSubject ( 'painlessStackTrace' ) ; expect ( painlessStackTrace ) . not . to . be ( undefined ) ; } ) ; } ) ; } ) ; }