Skip to content

Commit

Permalink
fixup TransactionClaim.spec
Browse files Browse the repository at this point in the history
  • Loading branch information
dni committed Jul 15, 2024
1 parent 9d4266b commit e6d39fc
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions tests/status/TransactionClaimed.spec.tsx
Original file line number Diff line number Diff line change
@@ -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(
() => (
Expand Down

0 comments on commit e6d39fc

Please sign in to comment.