"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * @jest-environment jsdom
 */
const react_1 = require("@testing-library/react");
const useSelectableCurrencies_1 = require("./useSelectableCurrencies");
const currencies_1 = require("../../../currencies");
describe("useSelectableCurrencies", () => {
    test("returns an empty array when empty list are passed", () => {
        const allCurrencies = [];
        const { result } = (0, react_1.renderHook)(() => (0, useSelectableCurrencies_1.useSelectableCurrencies)({ allCurrencies }));
        expect(result.current).toEqual([]);
    });
    test("returns an empty array when incorrect ids are passed", () => {
        const allCurrencies = ["ethercoin", "bitether", "polkamos"];
        const { result } = (0, react_1.renderHook)(() => (0, useSelectableCurrencies_1.useSelectableCurrencies)({ allCurrencies }));
        expect(result.current).toEqual([]);
    });
    test("returns correct currencies for all correct ids, in the same order", () => {
        const allCurrencies = ["ethereum", "bitcoin", "polkamos"];
        const ethereumCurrency = (0, currencies_1.getCryptoCurrencyById)("ethereum");
        const bitcoinCurrency = (0, currencies_1.getCryptoCurrencyById)("bitcoin");
        const { result } = (0, react_1.renderHook)(() => (0, useSelectableCurrencies_1.useSelectableCurrencies)({ allCurrencies }));
        expect(result.current).toHaveLength(2);
        expect(result.current).toEqual([ethereumCurrency, bitcoinCurrency]);
    });
});
//# sourceMappingURL=useSelectableCurrencies.test.js.map