-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
182 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,4 @@ | ||
export type ButtonLabelParams = { | ||
key: string; | ||
params?: Record<string, string>; | ||
}; | ||
|
||
export type SwapStatusTransaction = { | ||
hex?: string; | ||
id?: string; | ||
params?: Record; | ||
Check failure on line 3 in src/consts/Types.ts GitHub Actions / ci
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { render, screen } from "@solidjs/testing-library"; | ||
|
||
import { BTC } from "../../src/consts/Assets"; | ||
import i18n from "../../src/i18n/i18n"; | ||
import SwapExpired from "../../src/status/SwapExpired"; | ||
import { TestComponent, contextWrapper, payContext } from "../helper"; | ||
|
||
jest.mock("../../src/utils/boltzClient", () => { | ||
const originalModule = jest.requireActual("../../src/utils/boltzClient"); | ||
|
||
return { | ||
__esModule: true, | ||
...originalModule, | ||
getLockupTransaction: jest.fn(() => { | ||
return { id: "txid" }; | ||
}), | ||
}; | ||
}); | ||
|
||
describe("SwapExpired", () => { | ||
test("should show blockexplorer lockup transaction button", async () => { | ||
render( | ||
() => ( | ||
<> | ||
<TestComponent /> | ||
<SwapExpired /> | ||
</> | ||
), | ||
{ | ||
wrapper: contextWrapper, | ||
}, | ||
); | ||
payContext.setSwap({ | ||
assetSend: BTC, | ||
id: "swapid", | ||
} as any); | ||
|
||
const type_label = i18n.en[`blockexplorer_lockup_tx`]; | ||
const label = i18n.en.blockexplorer.replace( | ||
"{{ typeLabel }}", | ||
type_label, | ||
); | ||
|
||
const button = await screen.findByText(label); | ||
expect(button).not.toBeUndefined(); | ||
expect(button.getAttribute("href")).toMatch("txid"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.