From: Chris Duncan Date: Thu, 10 Jul 2025 14:45:28 +0000 (-0700) Subject: Expand initialization tests for Ledger. X-Git-Tag: v0.10.5~69 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=17bea88f8fcc544f484eb63b22cfdb2b33893fec;p=libnemo.git Expand initialization tests for Ledger. --- diff --git a/test/test.ledger.mjs b/test/test.ledger.mjs index 62eb225..fe21fa3 100644 --- a/test/test.ledger.mjs +++ b/test/test.ledger.mjs @@ -13,10 +13,14 @@ import { Account, LedgerWallet, ReceiveBlock, SendBlock } from '../dist/main.min */ await suite('Ledger hardware wallet', { skip: false || isNode }, async () => { - let wallet = await LedgerWallet.create(), account, openBlock, sendBlock, receiveBlock + let wallet, account, openBlock, sendBlock, receiveBlock await test('request permissions', async () => { + wallet = await LedgerWallet.create() let status = wallet.status + assert.equals(status, 'DISCONNECTED') + assert.equals(status, wallet.status) + status = await click( 'Reset permissions, unlock device, quit Nano app, then click to continue', async () => wallet.connect() @@ -25,7 +29,14 @@ await suite('Ledger hardware wallet', { skip: false || isNode }, async () => { assert.equals(status, wallet.status) status = await click( - 'Open Nano app on device, then click to continue', + 'Open Nano app on device, allow device to auto-lock, then click to continue', + async () => wallet.connect() + ) + assert.equals(status, 'LOCKED') + assert.equals(status, wallet.status) + + status = await click( + 'Unlock device, verify Nano app is open, then click to continue', async () => wallet.connect() ) assert.equals(status, 'CONNECTED')