import waitForExpect from 'wait-for-expect' ; import { ISearchFeature } from '../index' ; import { exampleTransactionData } from './helpers/exampleTransactionData' ; import { setupSearchFeature } from './helpers/setup' ; describe ( 'Searching for a transaction' , ( ) => { let search ; beforeEach ( ( ) => { search = setupSearchFeature ( ) ; search . start ( ) ; } ) ; afterEach ( ( ) => { search . stop ( ) ; } ) ; describe ( 'by a complete and valid ID' , ( ) => { it ( 'retrieves the transaction with expected data' , async ( ) => { search . actions . searchById . trigger ( { id : exampleTransactionData . id , } ) ; expect ( search . api . searchByIdQuery . isExecuting ) . toBe ( true ) ; await waitForExpect ( ( ) => { expect ( search . store ?. transactionSearchResult ?. totalOutput ) . toEqual ( '538861' ) ; } ) ; } ) ; } ) ; } ) ;