Skip to content

Commit

Permalink
chore(lld): move the var declarations in the useAddMember test to the…
Browse files Browse the repository at this point in the history
… top
  • Loading branch information
thesan committed Nov 4, 2024
1 parent eb8c9bf commit dcefea2
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@ import {
TrustchainAlreadyInitializedWithOtherSeed,
} from "@ledgerhq/ledger-key-ring-protocol/errors";

const device = { deviceId: "", modelId: DeviceModelId.stax, wired: true };
const trustchain = {
rootId: "trustchainId",
walletSyncEncryptionKey: "0x123",
applicationPath: "m/0'/16'/1'",
};

const Mocks = {
sdk: { getOrCreateTrustchain: jest.fn() },
memberCredentialsSelector: jest.fn(),
setTrustchain: jest.fn(),
setFlow: jest.fn(),
track: jest.fn(),
};

describe("useAddMember", () => {
it("should create a new trustchain", async () => {
Mocks.sdk.getOrCreateTrustchain.mockResolvedValue({
Expand Down Expand Up @@ -131,21 +146,6 @@ describe("useAddMember", () => {
});
});

const device = { deviceId: "", modelId: DeviceModelId.stax, wired: true };
const trustchain = {
rootId: "trustchainId",
walletSyncEncryptionKey: "0x123",
applicationPath: "m/0'/16'/1'",
};

const Mocks = {
sdk: { getOrCreateTrustchain: jest.fn() },
memberCredentialsSelector: jest.fn(),
setTrustchain: jest.fn(),
setFlow: jest.fn(),
track: jest.fn(),
};

jest.mock("react-redux", () => {
const dispatch = jest.fn();
return {
Expand Down

0 comments on commit dcefea2

Please sign in to comment.