From fa56035ac15a36e5032efd9ce0036d13d4a30790 Mon Sep 17 00:00:00 2001 From: Theophile Sandoz Date: Thu, 26 Sep 2024 15:27:18 +0200 Subject: [PATCH] =?UTF-8?q?chore(llm):=20=F0=9F=91=8C=20always=20skip=20th?= =?UTF-8?q?e=20analytics=20prompt=20in=20e2e=20tests=20(#7890)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(llm): always skip the analytics prompt in e2e tests * chore(llm): do not override llmAnalyticsOptInPrompt via the env file --- .changeset/strong-goats-rush.md | 5 +++++ apps/ledger-live-mobile/.env.mock | 2 +- apps/ledger-live-mobile/e2e/bridge/server.ts | 5 ++++- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .changeset/strong-goats-rush.md diff --git a/.changeset/strong-goats-rush.md b/.changeset/strong-goats-rush.md new file mode 100644 index 000000000000..319fbaa8634e --- /dev/null +++ b/.changeset/strong-goats-rush.md @@ -0,0 +1,5 @@ +--- +"live-mobile": patch +--- + +Always skip the analytics prompt in e2e tests diff --git a/apps/ledger-live-mobile/.env.mock b/apps/ledger-live-mobile/.env.mock index 49b3538d982f..920bb6c6f5d3 100644 --- a/apps/ledger-live-mobile/.env.mock +++ b/apps/ledger-live-mobile/.env.mock @@ -9,7 +9,7 @@ ADJUST_APP_TOKEN=cbxft2ch7wn4 BRAZE_ANDROID_API_KEY="be5e1bc8-43f1-4864-b097-076a3c693a43" BRAZE_IOS_API_KEY="e0a7dfaf-fc30-48f6-b998-01dbebbb73a4" BRAZE_CUSTOM_ENDPOINT="sdk.fra-02.braze.eu" -FEATURE_FLAGS={"ratingsPrompt":{"enabled":false},"brazePushNotifications":{"enabled":false},"llmAnalyticsOptInPrompt":{"enabled":false}} +FEATURE_FLAGS={"ratingsPrompt":{"enabled":false},"brazePushNotifications":{"enabled":false}} # Fix random iOS app crash https://github.com/wix/Detox/pull/3135 SIMCTL_CHILD_NSZombieEnabled=YES MOCK_REMOTE_LIVE_MANIFEST=[{"name":"Dummy Wallet API Live App","homepageUrl":"https://developers.ledger.com/","icon":"","platforms":["ios","android","desktop"],"apiVersion":"2.0.0","manifestVersion":"1","branch":"stable","categories":["tools"],"currencies":"*","content":{"shortDescription":{"en":"App to test the Wallet API"},"description":{"en":"App to test the Wallet API with Playwright"}},"permissions":["account.list","account.receive","account.request","currency.list","device.close","device.exchange","device.transport","message.sign","transaction.sign","transaction.signAndBroadcast","storage.set","storage.get","bitcoin.getXPub","wallet.capabilities","wallet.userId","wallet.info"],"domains":["http://*"],"visibility":"complete","id":"dummy-live-app","url":"http://localhost:52619"}] \ No newline at end of file diff --git a/apps/ledger-live-mobile/e2e/bridge/server.ts b/apps/ledger-live-mobile/e2e/bridge/server.ts index f8aa7291f47b..e70229d73c8c 100644 --- a/apps/ledger-live-mobile/e2e/bridge/server.ts +++ b/apps/ledger-live-mobile/e2e/bridge/server.ts @@ -2,6 +2,7 @@ import { Server, WebSocket } from "ws"; import path from "path"; import fs from "fs"; import net from "net"; +import merge from "lodash/merge"; import { toAccountRaw } from "@ledgerhq/live-common/account/index"; import { NavigatorName } from "../../src/const"; import { Subject } from "rxjs"; @@ -83,7 +84,9 @@ export async function loadConfig(fileName: string, agreed: true = true): Promise const { data } = JSON.parse(f.toString()); - await postMessage({ type: "importSettings", id: uniqueId(), payload: data.settings }); + const defaultSettings = { shareAnalytics: true, hasSeenAnalyticsOptInPrompt: true }; + const settings = merge(defaultSettings, data.settings); + await postMessage({ type: "importSettings", id: uniqueId(), payload: settings }); navigate(NavigatorName.Base);