import { delay } from '../commandCreators/atomic/delay' ; import { PauseArgs } from '../types' ; import { getSuccessResult } from '../fixtures' ; const getRobotInitialState = ( ) : any => { return { } ; } ; const invariantContext = { } ; let mixInArgs ; beforeEach ( ( ) => { mixInArgs = { commandCreatorFnName : 'delay' , meta : null , name : 'Delay Test' , description : 'test blah blah' , wait : true , } ; } ) ; describe ( 'delay indefinitely' , ( ) => { it ( '...' , ( ) => { const robotInitialState = getRobotInitialState ( ) ; const message = 'delay indefinitely message' ; const result = delay ( { ... mixInArgs , message , wait : true } , invariantContext , robotInitialState ) ; const res = getSuccessResult ( result ) ; expect ( res . commands ) . toEqual ( [ { command : 'delay' , params : { wait : true , message , } , } , ] ) ; } ) ; } ) ; describe ( 'delay for a given time' , ( ) => { it ( '...' , ( ) => { const robotInitialState = getRobotInitialState ( ) ; const message = 'delay 95.5 secs message' ; const result = delay ( { ... mixInArgs , message , wait : 95.5 } , invariantContext , robotInitialState ) ; const res = getSuccessResult ( result ) ; expect ( res . commands ) . toEqual ( [ { command : 'delay' , params : { wait : 95.5 , message , } , } , ] ) ; } ) ; } ) ;