mars-v2-frontend/__tests__/utils/vaults.test.ts
Yusuf Seyrek db9f222732
Mp 2993 update smart contracts (#262)
* feat: update contract addresses and types

* feat: add account type

* feat: comment out old contract vaults

* tests: disable vaults test suite

* instantiate contract-specfiic clients

* fix build

* rebase and fix test

---------

Co-authored-by: Bob van der Helm <34470358+bobthebuidlr@users.noreply.github.com>
2023-06-21 00:20:42 +02:00

35 lines
1.1 KiB
TypeScript

import { getVaultMetaData } from 'utils/vaults'
import * as constants from 'constants/env'
jest.mock('constants/env', () => ({
__esModule: true,
get IS_TESTNET() {
return true
},
}))
describe('getVaultMetaData()', () => {
afterAll(() => {
jest.restoreAllMocks()
})
it('returns the MAINNET vault of given address WHEN environment configured to mainnet', () => {
jest.spyOn(constants, 'IS_TESTNET', 'get').mockReturnValue(false)
const testAddress = 'osmo1g3kmqpp8608szfp0pdag3r6z85npph7wmccat8lgl3mp407kv73qlj7qwp'
const testVaultName = 'OSMO-ATOM'
expect(getVaultMetaData(testAddress)?.name).toBe(testVaultName)
})
// TODO: Update the following test suite accordingly after new testnet vaults placed in constants
// it('returns the TESTNET vault of given address WHEN environment configured to testnet', () => {
// jest.spyOn(constants, 'IS_TESTNET', 'get').mockReturnValue(true)
// const testAddress = 'osmo1q40xvrzpldwq5he4ftsf7zm2jf80tj373qaven38yqrvhex8r9rs8n94kv'
// const testVaultName = 'OSMO-USDC.n'
// expect(getVaultMetaData(testAddress)?.name).toBe(testVaultName)
// })
})