From 2b9a42709b8d9dfa2ce84526bf89640c1d87d9f6 Mon Sep 17 00:00:00 2001 From: Pedro Semeano Date: Thu, 9 Jan 2025 10:02:06 +0000 Subject: [PATCH] fix: remove aptos unit test for function assertions (#8839) * fix: aptos e2e test with speculos * fix: aptos bridge integration test * fix: remove tobe(function) assertions * fix: remove tobe(function) assertions from ledger account tests * chore: rollback changes * chore: rollback changes * test: add unit tests for currencyBridge methods * fix: bridge test * fix: bridge test --- .../src/families/aptos/LedgerAccount.test.ts | 10 ---------- .../src/families/aptos/bridge/js.test.ts | 9 ++++++++- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/libs/ledger-live-common/src/families/aptos/LedgerAccount.test.ts b/libs/ledger-live-common/src/families/aptos/LedgerAccount.test.ts index e43582e7e7b3..4a25e2420db4 100644 --- a/libs/ledger-live-common/src/families/aptos/LedgerAccount.test.ts +++ b/libs/ledger-live-common/src/families/aptos/LedgerAccount.test.ts @@ -12,25 +12,15 @@ describe("LedgerAccount Test", () => { it("builds the client properly", () => { expect(LedgerAccount.fromLedgerConnection).toBeDefined(); - expect(typeof LedgerAccount.fromLedgerConnection).toBe("function"); expect(account.init).toBeDefined(); - expect(typeof account.init).toBe("function"); expect(account.toAptosAccount).toBeDefined(); - expect(typeof account.toAptosAccount).toBe("function"); expect(account.hdWalletPath).toBeDefined(); - expect(typeof account.hdWalletPath).toBe("function"); expect(account.address).toBeDefined(); - expect(typeof account.address).toBe("function"); expect(account.authKey).toBeDefined(); - expect(typeof account.authKey).toBe("function"); expect(account.pubKey).toBeDefined(); - expect(typeof account.pubKey).toBe("function"); expect(account.asyncSignBuffer).toBeDefined(); - expect(typeof account.asyncSignBuffer).toBe("function"); expect(account.asyncSignHexString).toBeDefined(); - expect(typeof account.asyncSignHexString).toBe("function"); expect(account.signTransaction).toBeDefined(); - expect(typeof account.signTransaction).toBe("function"); expect(mockedLedgerAccount).toHaveBeenCalledTimes(1); }); diff --git a/libs/ledger-live-common/src/families/aptos/bridge/js.test.ts b/libs/ledger-live-common/src/families/aptos/bridge/js.test.ts index ce24ff1fe361..fc6a1c613328 100644 --- a/libs/ledger-live-common/src/families/aptos/bridge/js.test.ts +++ b/libs/ledger-live-common/src/families/aptos/bridge/js.test.ts @@ -33,7 +33,7 @@ describe("Aptos bridge interface ", () => { }); }); - describe("accountBridge ", () => { + describe("accountBridge", () => { it("should contain all methods", () => { expect(bridge.accountBridge.estimateMaxSpendable).toBeDefined(); expect(typeof bridge.accountBridge.estimateMaxSpendable).toBe("function"); @@ -53,8 +53,15 @@ describe("Aptos bridge interface ", () => { expect(typeof bridge.accountBridge.signOperation).toBe("function"); expect(bridge.accountBridge.broadcast).toBeDefined(); expect(typeof bridge.accountBridge.broadcast).toBe("function"); + expect(bridge.currencyBridge.hydrate).toBeDefined(); + expect(typeof bridge.currencyBridge.hydrate).toBe("function"); + expect(bridge.currencyBridge.preload).toBeDefined(); + expect(typeof bridge.currencyBridge.preload).toBe("function"); + expect(bridge.currencyBridge.scanAccounts).toBeDefined(); + expect(typeof bridge.currencyBridge.scanAccounts).toBe("function"); }); }); + describe("updateTransaction", () => { it("should update the transaction with the given patch", () => { const initialTransaction = {