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( () => (