Skip to content

Commit

Permalink
fix auto-utils tests (wallet changes)
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-aurele-besner committed Jul 4, 2024
1 parent a87479d commit fb9bfd5
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions packages/auto-utils/__test__/wallet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
NetworkInput,
WalletActivated,
activateWallet,
address,
mockWallets,
networks,
setupWallet,
Expand Down Expand Up @@ -34,18 +35,21 @@ describe('Verify wallet functions', () => {

describe('Test setupWallet()', () => {
test('Check setupWallet return a pair with matching address and public key when provided with a mnemonic', async () => {
const pair = await setupWallet({ mnemonic: TEST_MNEMONIC })
expect(pair.address).toEqual(TEST_ADDRESS)
const wallet = setupWallet({ mnemonic: TEST_MNEMONIC })
expect(wallet.commonAddress).toEqual(TEST_ADDRESS)
expect(wallet.address).toEqual(address(TEST_ADDRESS))
})

test('Check setupWallet return a pair with matching private key when provided with Alice seed', async () => {
const pair = await setupWallet({ uri: ALICE_URI })
expect(pair.address).toEqual(aliceWallet.address)
const wallet = setupWallet({ uri: ALICE_URI })
expect(wallet.commonAddress).toEqual(aliceWallet.address)
expect(wallet.address).toEqual(address(aliceWallet.address))
})

test('Check setupWallet return a pair with matching private key when provided with Bob seed', async () => {
const pair = await setupWallet({ uri: BOB_URI })
expect(pair.address).toEqual(bobWallet.address)
const wallet = setupWallet({ uri: BOB_URI })
expect(wallet.commonAddress).toEqual(bobWallet.address)
expect(wallet.address).toEqual(address(bobWallet.address))
})
})

Expand Down

0 comments on commit fb9bfd5

Please sign in to comment.