@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
29 lines • 1.35 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const currencies_1 = require("@ledgerhq/cryptoassets/currencies");
const cryptoIcons_1 = require("./cryptoIcons");
const tokens_1 = require("@ledgerhq/cryptoassets/tokens");
describe("inferCryptoCurrencyIcon", () => {
const registryMock = {
BTC: 1,
ETH: 2,
CURRENCY_ARBITRUM: 3,
USDT: 4,
};
test("Bitcoin Testnet is inferred properly", () => {
expect((0, cryptoIcons_1.inferCryptoCurrencyIcon)(registryMock, (0, currencies_1.getCryptoCurrencyById)("bitcoin_testnet"))).toBe(1);
});
test("Ethereum is inferred properly", () => {
expect((0, cryptoIcons_1.inferCryptoCurrencyIcon)(registryMock, (0, currencies_1.getCryptoCurrencyById)("ethereum"))).toBe(2);
});
test("Arbitrum is inferred properly", () => {
expect((0, cryptoIcons_1.inferCryptoCurrencyIcon)(registryMock, (0, currencies_1.getCryptoCurrencyById)("arbitrum"))).toBe(3);
});
test("USDT is inferred properly", () => {
const usdt = (0, tokens_1.findTokenById)("ethereum/erc20/usd_tether__erc20_");
if (!usdt)
throw new Error("USDT token not found");
expect((0, cryptoIcons_1.inferCryptoCurrencyIcon)(registryMock, usdt)).toBe(4);
});
});
//# sourceMappingURL=cryptoIcons.test.js.map