Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
Merge branch 'feat/aip-26-handling' of github.com:ArkEcosystem/deskto…
Browse files Browse the repository at this point in the history
…p-wallet into feat/aip-26-handling
  • Loading branch information
clucasalcantara committed Oct 6, 2020
2 parents 1397040 + 55cee52 commit a7340fc
Show file tree
Hide file tree
Showing 3 changed files with 1,392 additions and 196 deletions.
56 changes: 24 additions & 32 deletions src/app/hooks/use-deeplink.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@ describe("useDeeplink hook", () => {
};

it("should subscribe to deeplink listener", () => {
const ipcRendererSpy = jest
.spyOn(ipcRenderer, "on")
.mockImplementationOnce((event, callback) =>
callback(
event,
"ark:transfer?coin=ark&network=mainnet&recipient=DNjuJEDQkhrJ7cA9FZ2iVXt5anYiM8Jtc9&amount=1.2&memo=ARK",
),
);
ipcRenderer.on.mockImplementationOnce((event, callback) =>
callback(
event,
"ark:transfer?coin=ark&network=mainnet&recipient=DNjuJEDQkhrJ7cA9FZ2iVXt5anYiM8Jtc9&amount=1.2&memo=ARK",
),
);

const { getByText, history } = renderWithRouter(
<Route pathname="/">
Expand All @@ -49,14 +47,12 @@ describe("useDeeplink hook", () => {
});

it("should subscribe to deeplink listener and toast a warning to select a profile", () => {
const ipcRendererSpy = jest
.spyOn(ipcRenderer, "on")
.mockImplementationOnce((event, callback) =>
callback(
event,
"ark:transfer?coin=ark&network=mainnet&recipient=DNjuJEDQkhrJ7cA9FZ2iVXt5anYiM8Jtc9&amount=1.2&memo=ARK",
),
);
ipcRenderer.on.mockImplementationOnce((event, callback) =>
callback(
event,
"ark:transfer?coin=ark&network=mainnet&recipient=DNjuJEDQkhrJ7cA9FZ2iVXt5anYiM8Jtc9&amount=1.2&memo=ARK",
),
);

const { getByText, history } = renderWithRouter(
<Route pathname="/">
Expand All @@ -75,14 +71,12 @@ describe("useDeeplink hook", () => {
it("should subscribe to deeplink listener and toast a warning to select a wallet", () => {
window.history.pushState({}, "Deeplink Test", `/profiles/${getDefaultProfileId()}/dashboard`);

const ipcRendererSpy = jest
.spyOn(ipcRenderer, "on")
.mockImplementationOnce((event, callback) =>
callback(
event,
"ark:transfer?coin=ark&network=mainnet&recipient=DNjuJEDQkhrJ7cA9FZ2iVXt5anYiM8Jtc9&amount=1.2&memo=ARK",
),
);
ipcRenderer.on.mockImplementationOnce((event, callback) =>
callback(
event,
"ark:transfer?coin=ark&network=mainnet&recipient=DNjuJEDQkhrJ7cA9FZ2iVXt5anYiM8Jtc9&amount=1.2&memo=ARK",
),
);

const { getByText, history } = renderWithRouter(
<Route pathname="/profiles/:profileId">
Expand All @@ -105,14 +99,12 @@ describe("useDeeplink hook", () => {
`/profiles/${getDefaultProfileId()}/wallets/${getDefaultWalletId()}`,
);

const ipcRendererSpy = jest
.spyOn(ipcRenderer, "on")
.mockImplementationOnce((event, callback) =>
callback(
event,
"ark:transfer?coin=ark&network=mainnet&recipient=DNjuJEDQkhrJ7cA9FZ2iVXt5anYiM8Jtc9&amount=1.2&memo=ARK",
),
);
ipcRenderer.on.mockImplementationOnce((event, callback) =>
callback(
event,
"ark:transfer?coin=ark&network=mainnet&recipient=DNjuJEDQkhrJ7cA9FZ2iVXt5anYiM8Jtc9&amount=1.2&memo=ARK",
),
);

const { getByText, history } = renderWithRouter(
<Route pathname="/profiles/:profileId/wallets/:walletId">
Expand Down
Loading

0 comments on commit a7340fc

Please sign in to comment.