]> git.codecow.com Git - libnemo.git/commitdiff
Expand Ledger wallet creation test.
authorChris Duncan <chris@zoso.dev>
Mon, 7 Jul 2025 15:32:33 +0000 (08:32 -0700)
committerChris Duncan <chris@zoso.dev>
Mon, 7 Jul 2025 15:32:33 +0000 (08:32 -0700)
test/test.create-wallet.mjs

index bafffafa35b5c9cff2f946f7cc1d8c4af6e49e77..16822afef23219fda21be88f530d6367d3df9ce4 100644 (file)
@@ -57,9 +57,19 @@ await suite('Create wallets', async () => {
                await assert.rejects(Blake2bWallet.create())\r
        })\r
 \r
-       await test('connect to ledger', { skip: true }, async () => {\r
+       await test('connect to a Ledger device', { skip: false }, async () => {\r
                const wallet = await LedgerWallet.create()\r
-               assert.ok(wallet)\r
-               await wallet.destroy()\r
+               let status = await new Promise(resolve => {\r
+                       const button = document.createElement('button')\r
+                       button.innerText = 'Unlock Ledger, then click to continue'\r
+                       button.addEventListener('click', async (event) => {\r
+                               const connection = await wallet.connect()\r
+                               document.body.removeChild(button)\r
+                               resolve(connection)\r
+                       })\r
+                       document.body.appendChild(button)\r
+               })\r
+\r
+               assert.equals(status, 'CONNECTED')\r
        })\r
 })\r