Skip to content

Commit

Permalink
feat: wallet sync synchronize via qr code from mobile to desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrellard-ledger committed Aug 23, 2024
1 parent 90c266f commit 2ea0981
Showing 1 changed file with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,25 @@ import { render, screen, waitFor } from "@tests/test-renderer";
import { INITIAL_TEST, WalletSyncSettingsNavigator } from "./shared";
import getWalletSyncEnvironmentParams from "@ledgerhq/live-common/walletSync/getEnvironmentParams";

jest.mock("@ledgerhq/trustchain/qrcode/index", () => ({
createQRCodeHostInstance: () => ({
trustchainApiBaseUrl: getWalletSyncEnvironmentParams("STAGING").trustchainApiBaseUrl,
onDisplayQRCode: jest.fn().mockImplementation(url => url),
onDisplayDigits: jest.fn().mockImplementation(digits => digits),
addMember: jest.fn(),
jest.mock("../hooks/useQRCodeHost", () => ({
useQRCodeHost: () => ({
setCurrentStep: jest.fn(),
currentStep: jest.fn(),
currentOption: jest.fn(),
url: "ledger.com",
}),
}));

jest.mock("@ledgerhq/trustchain/qrcode/index", () => ({
createQRCodeHostInstance: () =>
Promise.resolve({
trustchainApiBaseUrl: getWalletSyncEnvironmentParams("STAGING").trustchainApiBaseUrl,
onDisplayQRCode: jest.fn().mockImplementation(url => url),
onDisplayDigits: jest.fn().mockImplementation(digits => digits),
addMember: jest.fn(),
}),
}));

describe("SynchronizeWithQrCode", () => {
it("Should display the QR code when 'show qr' toggle is pressed and add a new member through the flow", async () => {
const { user } = render(<WalletSyncSettingsNavigator />, {
Expand Down

0 comments on commit 2ea0981

Please sign in to comment.