From 3260e30fc7c36ea9d544d1bfed7ca7dfcf6f8e89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Mon, 15 Jul 2024 17:30:03 +0200 Subject: [PATCH] fixup TransactionClaim.spec --- src/pages/Pay.tsx | 8 +------- tests/status/TransactionClaimed.spec.tsx | 26 +++++++----------------- 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/src/pages/Pay.tsx b/src/pages/Pay.tsx index 01edfb03..e304d689 100644 --- a/src/pages/Pay.tsx +++ b/src/pages/Pay.tsx @@ -1,12 +1,6 @@ import { useParams } from "@solidjs/router"; import log from "loglevel"; -import { - Match, - Show, - Switch, - createEffect, - onCleanup, -} from "solid-js"; +import { Match, Show, Switch, createEffect, onCleanup } from "solid-js"; import LoadingSpinner from "../components/LoadingSpinner"; import { SwapIcons } from "../components/SwapIcons"; diff --git a/tests/status/TransactionClaimed.spec.tsx b/tests/status/TransactionClaimed.spec.tsx index 6b48cabf..044e54cd 100644 --- a/tests/status/TransactionClaimed.spec.tsx +++ b/tests/status/TransactionClaimed.spec.tsx @@ -1,30 +1,18 @@ import { render, screen } from "@solidjs/testing-library"; -import { BTC, LBTC, RBTC } from "../../src/consts/Assets"; +import { BTC, LBTC, LN, RBTC } from "../../src/consts/Assets"; import i18n from "../../src/i18n/i18n"; import TransactionClaimed from "../../src/status/TransactionClaimed"; import { TestComponent, contextWrapper, payContext } from "../helper"; -jest.mock("../../src/utils/boltzClient", () => ({ - getReverseTransaction: jest.fn().mockResolvedValue({ - hex: "txHex", - }), -})); - describe("TransactionClaimed", () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - test.each` - name | swap - ${"normal swaps"} | ${{ reverse: false }} - ${"reverse swaps to RBTC"} | ${{ - reverse: true, - asset: RBTC, -}} - ${"reverse swaps to BTC with claim transactions"} | ${{ reverse: true, asset: BTC, claimTx: "txid" }} - ${"reverse swaps to L-BTC with claim transactions"} | ${{ reverse: true, asset: LBTC, claimTx: "txid" }} + name | swap + ${"normal swaps"} | ${{ assetSend: RBTC, assetReceive: LN, address: "address" }} + ${"reverse swaps to RBTC"} | ${{ assetSend: LN, assetReceive: RBTC, claimTx: "txid" }} + ${"reverse swaps to BTC with claim transactions"} | ${{ assetSend: LN, assetReceive: LBTC, claimTx: "txid" }} + ${"reverse swaps to L-BTC with claim transactions"} | ${{ assetSend: LN, assetReceive: BTC, claimTx: "txid" }} + ${"chain swaps BTC to L-BTC with claim transactions"} | ${{ assetSend: BTC, assetReceive: LBTC, claimTx: "txid" }} `("should show success for $name", async ({ swap }) => { render( () => (