From 49e7c4078ccf9a247ef40bca9edb27421d318e9a Mon Sep 17 00:00:00 2001 From: sarneijim Date: Mon, 23 Sep 2024 07:21:14 +0100 Subject: [PATCH] fix: fix tests --- lib/src/api.ts | 2 +- lib/src/sdk.test.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/src/api.ts b/lib/src/api.ts index 51c6fc9..a0d5d0a 100644 --- a/lib/src/api.ts +++ b/lib/src/api.ts @@ -188,7 +188,7 @@ export interface SellResponsePayload { const parseSellBackendInfo = (response: SellResponsePayload) => { return { - sellId: response.sellId, + quoteId: response.sellId, payinAddress: response.payinAddress, providerSig: { payload: response.providerSig.payload, diff --git a/lib/src/sdk.test.ts b/lib/src/sdk.test.ts index e8502c8..cd4b43c 100644 --- a/lib/src/sdk.test.ts +++ b/lib/src/sdk.test.ts @@ -13,6 +13,8 @@ import { confirmSwap, cancelSwap, retrieveSellPayload, + confirmSell, + cancelSell, } from "./api"; import { ExchangeSDK, FeeStrategy } from "./sdk"; import { getCustomModule } from "./wallet-api"; @@ -217,6 +219,16 @@ describe("swap", () => { }); describe("sell", () => { + beforeAll(() => { + (retrieveSellPayload as jest.Mock).mockResolvedValue({ + binaryPayload: "", + signature: "", + payinAddress: "", + quoteId: "sell-id", + }); + (confirmSell as jest.Mock).mockResolvedValue({}); + (cancelSell as jest.Mock).mockResolvedValue({}); + }); it("sends back the 'transactionId' from the WalletAPI", async () => { // GIVEN const currencies: Array> = [