11import { getLockupContract } from './common'
2- import { Options , positionsCreate } from './positionsCreate'
2+ import { positionsCreate } from './positionsCreate'
33import { testProviders } from '../common/const'
44import { stubTransactionResposeFactory } from '../../common/utils/for-test'
55
@@ -10,36 +10,29 @@ jest.mock('./common', () => {
1010} )
1111
1212describe ( 'positionsCreate.ts' , ( ) => {
13- const propertyAddress = '0x38c4bF6cD20d157EE45553b0fAD13B0c6750b439'
14- const amount = '100'
1513 const overrides = {
1614 overrides : undefined ,
1715 fallback : undefined ,
1816 }
17+ const options = {
18+ provider : testProviders . ropsten ,
19+ propertyAddress : '0x38c4bF6cD20d157EE45553b0fAD13B0c6750b439' ,
20+ amount : '100' ,
21+ overrides,
22+ }
1923
2024 it ( 'success' , async ( ) => {
2125 const stubTx = stubTransactionResposeFactory ( { } )
2226 ; ( getLockupContract as jest . Mock ) . mockReturnValue ( {
2327 depositToProperty : ( propertyAddress : string , amount : number ) => stubTx ,
2428 } )
25- const options : Options = {
26- provider : testProviders . ropsten ,
27- propertyAddress,
28- amount,
29- overrides,
30- }
29+
3130 const result = await positionsCreate ( options )
3231 expect ( getLockupContract ) . toHaveBeenCalledTimes ( 1 )
3332 expect ( result ) . toEqual ( stubTx )
3433 } )
3534 it ( 'return undefined if network is not valid' , async ( ) => {
3635 ; ( getLockupContract as jest . Mock ) . mockReturnValue ( undefined )
37- const options : Options = {
38- provider : testProviders . polyMumbai ,
39- propertyAddress,
40- amount,
41- overrides,
42- }
4336 expect ( await positionsCreate ( options ) ) . toEqual ( undefined )
4437 } )
4538} )
0 commit comments