Skip to content

Commit

Permalink
fix: Connection "address" was not found in test
Browse files Browse the repository at this point in the history
  • Loading branch information
classicalliu committed Jul 30, 2019
1 parent f78e1f4 commit c121a09
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/neuron-wallet/tests/services/wallets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ import Keystore from '../../src/models/keys/keystore'
import Keychain from '../../src/models/keys/keychain'
import { mnemonicToSeedSync } from '../../src/models/keys/mnemonic'
import { ExtendedPrivateKey, AccountExtendedPublicKey } from '../../src/models/keys/key'
import AddressService from '../../src/services/addresses'

const mockDeleteAddressByWalletId = () => {
const mockDeleteAddress = jest.fn()
mockDeleteAddress.mockReturnValue(undefined)
AddressService.deleteByWalletId = mockDeleteAddress.bind(AddressService)
}

describe('wallet service', () => {
let walletService: WalletService
Expand Down Expand Up @@ -115,6 +122,7 @@ describe('wallet service', () => {
})

it('delete wallet', () => {
mockDeleteAddressByWalletId()
const w1 = walletService.create(wallet1)
walletService.create(wallet2)
expect(walletService.getAll().length).toBe(2)
Expand Down Expand Up @@ -147,6 +155,7 @@ describe('wallet service', () => {
})

it('delete current wallet', () => {
mockDeleteAddressByWalletId()
const w1 = walletService.create(wallet1)
const w2 = walletService.create(wallet2)
walletService.delete(w1.id)
Expand All @@ -156,6 +165,7 @@ describe('wallet service', () => {
})

it('delete none current wallet', () => {
mockDeleteAddressByWalletId()
const w1 = walletService.create(wallet1)
const w2 = walletService.create(wallet2)
walletService.delete(w2.id)
Expand Down

0 comments on commit c121a09

Please sign in to comment.