Skip to content

Commit

Permalink
Merge pull request #7955 from LedgerHQ/fix/live-14304
Browse files Browse the repository at this point in the history
LLM - fix wording for ledger sync on activation
  • Loading branch information
KVNLS authored Oct 1, 2024
2 parents a7696cc + 5d825f2 commit a390b89
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 52 deletions.
5 changes: 5 additions & 0 deletions .changeset/yellow-flowers-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": minor
---

LLM - Fix wording for Ledger Sync on activation
11 changes: 5 additions & 6 deletions apps/ledger-live-mobile/src/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -6766,22 +6766,21 @@
}
},
"deviceSelection": {
"title": "Choose your Ledger device",
"description": "You can retrieve your backup by simply connecting your Ledger to the Ledger Live mobile and desktop apps."
"title": "Choose a Ledger device"
},
"deviceAction": {
"title": "Continue on your Ledger {{wording}}",
"description": "Follow the instruction which appear on your Ledger’s Trusted Display."
},
"loading": {
"title": "Hang tight...",
"activation": "Your data is being end-to-end encrypted... ",
"activation": "This can take up to 30 seconds.\nPlease stay on this screen.",
"synch": "We are updating the synched instances..."
},
"success": {
"sync": "Sync successful",
"syncDesc": "Changes in your crypto accounts will now automatically appear across Ledger Live apps on synched phones and computers.",
"activation": "Ledger Sync turned on for Ledger Live on this phone",
"activation": "Ledger Sync turned on for this phone",
"syncAnother": "Sync with another Ledger Live app",
"close": "Close"
},
Expand Down Expand Up @@ -6835,10 +6834,10 @@
"chooseMethod": {
"title": "Choose your sync method",
"scan": {
"title": "Scan a QR code"
"title": "Scan QR code"
},
"connectDevice": {
"title": "Use your Ledger"
"title": "Use my Ledger device"
}
},
"qrCode": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { screen } from "@testing-library/react-native";
import { render, act } from "@tests/test-renderer";
import { render } from "@tests/test-renderer";
import { TestButtonPage } from "./shared";
import { State } from "~/reducers/types";

Expand Down Expand Up @@ -33,25 +33,19 @@ describe("AddAccount", () => {
const addAssetButton = await screen.findByText(/Add asset/i);

// Check if the add asset button is visible
await expect(addAssetButton).toBeVisible();
expect(addAssetButton).toBeVisible();
// Open drawer
await act(async () => {
await user.press(addAssetButton);
});
await user.press(addAssetButton);
// Wait for the drawer to open
await expect(await screen.findByText(/add another account/i));
await expect(await screen.findByText(/Use your Ledger device/i));
await expect(await screen.findByText(/Use Ledger Sync/i));
expect(await screen.findByText(/add another account/i));
expect(await screen.findByText(/Use your Ledger device/i));
expect(await screen.findByText(/Use Ledger Sync/i));
// On press add with another ledger live app
await act(async () => {
await user.press(await screen.getByText(/Use your Ledger device/i));
});
await expect(await screen.findByText(/crypto asset/i)).toBeVisible();
await user.press(screen.getByText(/Use your Ledger device/i));
expect(await screen.findByText(/crypto asset/i)).toBeVisible();
// On click back
await act(async () => {
await user.press(await screen.findByTestId(/navigation-header-back-button/i));
});
await expect(addAssetButton).toBeVisible();
await user.press(await screen.findByTestId(/navigation-header-back-button/i));
expect(addAssetButton).toBeVisible();
});

/**====== Import with WS test =======*/
Expand Down Expand Up @@ -81,21 +75,17 @@ describe("AddAccount", () => {

const addAssetButton = await screen.findByText(/Add asset/i);
// Check if the add asset button is visible
await expect(addAssetButton).toBeVisible();
expect(addAssetButton).toBeVisible();
// Open drawer
await act(async () => {
await user.press(addAssetButton);
});
await user.press(addAssetButton);
// Wait for the drawer to open
await expect(await screen.findByText(/add another account/i));
await expect(await screen.findByText(/Use your Ledger device/i));
await expect(await screen.findByText(/Use Ledger Sync/i));
expect(await screen.findByText(/add another account/i));
expect(await screen.findByText(/Use your Ledger device/i));
expect(await screen.findByText(/Use Ledger Sync/i));
// On press add with wallet sync
await act(async () => {
await user.press(await screen.getByText(/Use Ledger Sync/i));
});
await expect(await screen.findByText(/choose your sync method/i)).toBeVisible();
await expect(await screen.findByText(/Scan a QR code/i));
await user.press(screen.getByText(/Use Ledger Sync/i));
expect(await screen.findByText(/choose your sync method/i)).toBeVisible();
expect(await screen.findByText(/Scan QR code/i));
});

/**====== Import from desktop Test =======*/
Expand All @@ -113,17 +103,15 @@ describe("AddAccount", () => {

const addAssetButton = await screen.findByText(/add asset/i);
// Check if the add asset button is visible
await expect(addAssetButton).toBeVisible();
expect(addAssetButton).toBeVisible();
// Open drawer
await user.press(addAssetButton);
// Wait for the drawer to open
await expect(await screen.findByText(/add another account/i));
await expect(await screen.findByText(/Use your Ledger device/i));
await expect(await screen.findByText(/import from desktop/i));
expect(await screen.findByText(/add another account/i));
expect(await screen.findByText(/Use your Ledger device/i));
expect(await screen.findByText(/import from desktop/i));
// On press add from desktop
await user.press(await screen.getByText(/import from desktop/i));
await expect(
await screen.findByText(/Scan and import your accounts from Ledger Live desktop/i),
);
await user.press(screen.getByText(/import from desktop/i));
expect(await screen.findByText(/Scan and import your accounts from Ledger Live desktop/i));
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { render, screen } from "@tests/test-renderer";
import { INITIAL_TEST, WalletSyncSettingsNavigator } from "./shared";

describe("scanQRCode", () => {
it("Should open the QR code scene when 'scan a qr code' toggle is pressed", async () => {
it("Should open the QR code scene when 'scan qr code' toggle is pressed", async () => {
const { user } = render(<WalletSyncSettingsNavigator />, {
overrideInitialState: INITIAL_TEST,
});
await user.press(await screen.findByText(/ledger sync/i));
await user.press(await screen.findByText(/I already turned it on/i));
await user.press(await screen.findByText(/scan a qr code/i));
await user.press(await screen.findByText(/scan qr code/i));
await expect(screen.queryAllByText(/show qr/i)).toHaveLength(2);
await expect(screen.getByTestId("ws-scan-camera")).toBeVisible();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe("SynchronizeWithQrCode", () => {
});
await user.press(await screen.findByText(/ledger sync/i));
await user.press(await screen.findByText(/I already turned it on/i));
await user.press(await screen.findByText(/scan a qr code/i));
await user.press(await screen.findByText(/scan qr code/i));
await user.press(await screen.queryAllByText(/show qr/i)[0]);
expect(await screen.getByTestId("ws-qr-code-displayed")).toBeVisible();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ describe("WalletSyncActivation", () => {
}),
);

await user.press(screen.getByText(/use your ledger/i));
await user.press(screen.getByText(/use my ledger/i));

expect(await screen.findByText(/Choose your Ledger device/i)).toBeVisible();
expect(await screen.findByText(/Choose a Ledger device/i)).toBeVisible();

await user.press(
await screen.findByRole("button", {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,13 @@ const WalletSyncActivationDeviceSelection: React.FC<ChooseDeviceProps> = ({
if (!isFocused) return null;

return (
<SafeAreaView edges={["top", "left", "right"]} style={{ flex: 1 }}>
<SafeAreaView edges={["left", "right"]} style={{ flex: 1 }}>
<TrackScreen category="Manager" name="ChooseDevice" />
{!isHeaderOverridden ? (
<Flex px={16} pb={8}>
<Text fontWeight="semiBold" variant="h4">
<Trans i18nKey="walletSync.deviceSelection.title" />
</Text>

<Text pt={3} fontWeight="medium" variant="bodyLineHeight" color="neutral.c70">
<Trans i18nKey="walletSync.deviceSelection.description" />
</Text>
</Flex>
) : null}
<Flex flex={1} mb={8}>
Expand Down

0 comments on commit a390b89

Please sign in to comment.