From 9d6291dd5dd6f4c7a5f9e7a3f83deb2df7940f8d Mon Sep 17 00:00:00 2001 From: Victor Alber Date: Mon, 23 Dec 2024 10:40:03 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=92=9A=20updating=20method=20to=20?= =?UTF-8?q?get=20the=20last=20appVersion=20-=20Speculos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/specs/speculos/delegate.spec.ts | 15 +++++++++++---- libs/ledger-live-common/src/e2e/speculos.ts | 6 +++++- libs/ledger-live-common/src/load/speculos.ts | 3 +-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts index eceb91be039a..ec64b33a674b 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/delegate.spec.ts @@ -10,7 +10,7 @@ const e2eDelegationAccounts = [ { delegate: new Delegate(Account.ATOM_1, "0.001", "Ledger"), xrayTicket: "B2CQA-2740, B2CQA-2770", - bugLing: "LIVE-14501", + bugTicket: "LIVE-14501", }, { delegate: new Delegate(Account.SOL_1, "0.001", "Ledger by Figment"), @@ -38,6 +38,7 @@ const validators = [ { delegate: new Delegate(Account.ADA_1, "0.01", "LBF3 - Ledger by Figment 3"), xrayTicket: "B2CQA-2766", + bugTicket: "LIVE-15536", }, { delegate: new Delegate(Account.MULTIVERS_X_1, "1", "Ledger by Figment"), @@ -72,12 +73,12 @@ test.describe("Delegate flows", () => { { annotation: [ { type: "TMS", description: account.xrayTicket }, - { type: "BUG", description: account.bugLing }, + { type: "BUG", description: account.bugTicket }, ], }, async ({ app }) => { await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); - if (account.bugLing) { + if (account.bugTicket) { await addBugLink(getDescription(test.info().annotations, "BUG").split(", ")); } @@ -133,10 +134,16 @@ test.describe("Delegate flows", () => { test( `[${validator.delegate.account.currency.name}] - Select validator`, { - annotation: { type: "TMS", description: validator.xrayTicket }, + annotation: [ + { type: "TMS", description: validator.xrayTicket }, + { type: "BUG", description: validator.bugTicket }, + ], }, async ({ app }) => { await addTmsLink(getDescription(test.info().annotations, "TMS").split(", ")); + if (validator.bugTicket) { + await addBugLink(getDescription(test.info().annotations, "BUG").split(", ")); + } await app.layout.goToAccounts(); await app.accounts.navigateToAccountByName(validator.delegate.account.accountName); diff --git a/libs/ledger-live-common/src/e2e/speculos.ts b/libs/ledger-live-common/src/e2e/speculos.ts index 31d5bca468ed..909122360ebe 100644 --- a/libs/ledger-live-common/src/e2e/speculos.ts +++ b/libs/ledger-live-common/src/e2e/speculos.ts @@ -277,7 +277,11 @@ export async function startSpeculos( const { model } = appQuery; const { dependencies } = spec; const newAppQuery = dependencies?.map(dep => { - return findLatestAppCandidate(appCandidates, { model, appName: dep.name }); + return findLatestAppCandidate(appCandidates, { + model, + appName: dep.name, + firmware: appCandidate?.firmware, + }); }); const appVersionMap = new Map(newAppQuery?.map(app => [app?.appName, app?.appVersion])); dependencies?.forEach(dependency => { diff --git a/libs/ledger-live-common/src/load/speculos.ts b/libs/ledger-live-common/src/load/speculos.ts index 8ede263d7a9b..a4c23cc6dd5d 100644 --- a/libs/ledger-live-common/src/load/speculos.ts +++ b/libs/ledger-live-common/src/load/speculos.ts @@ -132,8 +132,7 @@ export const findLatestAppCandidate = ( if (apps.length === 0) { return null; } - - apps = apps.sort((a, b) => semver.rcompare(a.appVersion, b.appVersion)); + apps = apps.sort((a, b) => semver.compare(b.appVersion, a.appVersion)); return apps[0]; };