Skip to content

Commit

Permalink
fix: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sarneijim committed Sep 23, 2024
1 parent d096585 commit 49e7c40
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 12 additions & 0 deletions lib/src/sdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import {
confirmSwap,
cancelSwap,
retrieveSellPayload,
confirmSell,
cancelSell,
} from "./api";
import { ExchangeSDK, FeeStrategy } from "./sdk";
import { getCustomModule } from "./wallet-api";
Expand Down Expand Up @@ -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<Partial<Currency>> = [
Expand Down

0 comments on commit 49e7c40

Please sign in to comment.