UNPKG

@yoroi/swap

Version:
31 lines (30 loc) 1.53 kB
"use strict"; var _helpers = require("./helpers"); var _types = require("./types"); const allDexes = [_types.Dex.Muesliswap, _types.Dex.Muesliswap_v1, _types.Dex.Muesliswap_v2, _types.Dex.Muesliswap_clp, _types.Dex.Muesliswap_orderbook, _types.Dex.Minswap_v1, _types.Dex.Minswap_v2, _types.Dex.Minswap_stable, _types.Dex.Spectrum_v1, _types.Dex.Teddy_v1, _types.Dex.Wingriders_v1, _types.Dex.Wingriders_v2, _types.Dex.Wingriders_stable, _types.Dex.Vyfi_v1, _types.Dex.Sundaeswap_v1, _types.Dex.Sundaeswap_v3, _types.Dex.Cswap_v1, _types.Dex.Splash_v4, _types.Dex.Splash_v5, _types.Dex.Splash_v6, _types.Dex.Splash_degen_quad]; describe('getAllowedDexes', () => { it('should return all DEXes except blocked ones/unsupported', () => { const result = (0, _helpers.getAllowedDexes)({ blocked: [_types.Dex.Minswap_stable] }); const expected = allDexes.filter(dex => dex !== _types.Dex.Minswap_stable); expect(result).toEqual(expected); }); it('should return all DEXes if none are blocked', () => { const result = (0, _helpers.getAllowedDexes)({ blocked: [] }); expect(result).toEqual(allDexes); }); it('should return all DEXes if no arg is passed', () => { const result = (0, _helpers.getAllowedDexes)(); expect(result).toEqual(allDexes); }); it('should return an empty array if all DEXes are blocked', () => { const result = (0, _helpers.getAllowedDexes)({ blocked: allDexes }); expect(result).toEqual([]); }); }); //# sourceMappingURL=helpers.test.js.map