From cc8ba09dc97a63b5ec643f36bfed6b05204819c0 Mon Sep 17 00:00:00 2001 From: emmanuelm41 Date: Thu, 31 Oct 2024 15:15:46 -0300 Subject: [PATCH] chore: adapt zemu test for blindsigning mode --- tests_zemu/package.json | 2 +- .../tests/big_transactions_shortchut.test.ts | 20 +++---------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/tests_zemu/package.json b/tests_zemu/package.json index 6c655ed..fa59ce1 100644 --- a/tests_zemu/package.json +++ b/tests_zemu/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "@zondax/ledger-algorand": "../js", - "@zondax/zemu": "^0.51.0" + "@zondax/zemu": "^0.51" }, "devDependencies": { "@ledgerhq/hw-transport-node-hid" : "^6.29.5", diff --git a/tests_zemu/tests/big_transactions_shortchut.test.ts b/tests_zemu/tests/big_transactions_shortchut.test.ts index 6f9a003..72ed94a 100644 --- a/tests_zemu/tests/big_transactions_shortchut.test.ts +++ b/tests_zemu/tests/big_transactions_shortchut.test.ts @@ -53,33 +53,19 @@ describe('BigTransactions - Shortcut', function () { const txBlob = Buffer.from(txApplicationLong, 'hex') console.log(sim.getMainMenuSnapshot()) - // Enable expert mode - await sim.toggleExpertMode(`${m.prefix.toLowerCase()}-sign_application_big_shortcut`, true, 0); + // Enable blind signing mode + await sim.toggleBlindSigning(`${m.prefix.toLowerCase()}-sign_application_big_shortcut`, false, 0); - // Toggle shortcut mode on nano s, s+ and x devices, and compare - const snapshotsDelta = m.name == "nanos" ? 3 : 0 - let nav = new ClickNavigation([2, 0, 5 + snapshotsDelta, 0]) - await sim.navigateAndCompareSnapshots(".", `${m.prefix.toLowerCase()}-sign_application_big_shortcut`, nav.schedule, true, 3); - - // Take snapshots of the shortcut mode and compare - nav = new ClickNavigation([2, -2]) - await sim.navigateAndCompareSnapshots(".", `${m.prefix.toLowerCase()}-sign_application_big_shortcut`, nav.schedule, true, 12 + snapshotsDelta); - - console.log(sim.getMainMenuSnapshot()) const responseAddr = await app.getAddressAndPubKey(accountId) const pubKey = responseAddr.publicKey - await sim.deleteEvents() - // do not wait here.. we need to navigate const signatureRequest = app.sign(accountId, txBlob) // Wait until we are not in the main menu await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot()) - // Click on "skip fields" and approve - nav = new ClickNavigation([1, 0, 0]) - await sim.navigateAndCompareSnapshots(".", `${m.prefix.toLowerCase()}-sign_application_big_shortcut`, nav.schedule, true, 17 + snapshotsDelta); + await sim.compareSnapshotsAndApprove(".", `${m.prefix.toLowerCase()}-sign_application_big_shortcut`, true, 0, 3000, true); const signatureResponse = await signatureRequest console.log(signatureResponse)