From e6d39fc8a23aacebf7d2b1644a8f2ab2b95be577 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 --- tests/status/TransactionClaimed.spec.tsx | 26 +++++++----------------- 1 file changed, 7 insertions(+), 19 deletions(-) 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( () => (