@yoroi/swap
Version:
The Swap package of Yoroi SDK
50 lines (49 loc) • 3.18 kB
JavaScript
;
var _types = require("@yoroi/types");
var _getDexByProtocol = require("./getDexByProtocol");
describe('getDexByProtocol', () => {
it('should return Minswap for Minswap protocols', () => {
expect((0, _getDexByProtocol.getDexByProtocol)(_types.Swap.Protocol.Minswap_v1)).toBe(_types.Swap.Dex.Minswap);
expect((0, _getDexByProtocol.getDexByProtocol)(_types.Swap.Protocol.Minswap_v2)).toBe(_types.Swap.Dex.Minswap);
expect((0, _getDexByProtocol.getDexByProtocol)(_types.Swap.Protocol.Minswap_stable)).toBe(_types.Swap.Dex.Minswap);
});
it('should return Muesliswap for Muesliswap protocols', () => {
expect((0, _getDexByProtocol.getDexByProtocol)(_types.Swap.Protocol.Muesliswap_v2)).toBe(_types.Swap.Dex.Muesliswap);
expect((0, _getDexByProtocol.getDexByProtocol)(_types.Swap.Protocol.Muesliswap_clp)).toBe(_types.Swap.Dex.Muesliswap);
});
it('should return Spectrum for Spectrum protocol', () => {
expect((0, _getDexByProtocol.getDexByProtocol)(_types.Swap.Protocol.Spectrum_v1)).toBe(_types.Swap.Dex.Spectrum);
});
it('should return Sundaeswap for Sundaeswap protocols', () => {
expect((0, _getDexByProtocol.getDexByProtocol)(_types.Swap.Protocol.Sundaeswap_v1)).toBe(_types.Swap.Dex.Sundaeswap);
expect((0, _getDexByProtocol.getDexByProtocol)(_types.Swap.Protocol.Sundaeswap_v3)).toBe(_types.Swap.Dex.Sundaeswap);
});
it('should return Teddy for Teddy protocol', () => {
expect((0, _getDexByProtocol.getDexByProtocol)(_types.Swap.Protocol.Teddy_v1)).toBe(_types.Swap.Dex.Teddy);
});
it('should return Vyfi for Vyfi protocol', () => {
expect((0, _getDexByProtocol.getDexByProtocol)(_types.Swap.Protocol.Vyfi_v1)).toBe(_types.Swap.Dex.Vyfi);
});
it('should return Wingriders for Wingriders protocols', () => {
expect((0, _getDexByProtocol.getDexByProtocol)(_types.Swap.Protocol.Wingriders_v1)).toBe(_types.Swap.Dex.Wingriders);
expect((0, _getDexByProtocol.getDexByProtocol)(_types.Swap.Protocol.Wingriders_v2)).toBe(_types.Swap.Dex.Wingriders);
});
it('should return Splash for Splash protocol', () => {
expect((0, _getDexByProtocol.getDexByProtocol)(_types.Swap.Protocol.Splash_v1)).toBe(_types.Swap.Dex.Splash);
});
it('should return Cswap for Cswap protocol', () => {
expect((0, _getDexByProtocol.getDexByProtocol)(_types.Swap.Protocol.Cswap)).toBe(_types.Swap.Dex.Cswap);
});
it('should return Unsupported for Unsupported protocol', () => {
expect((0, _getDexByProtocol.getDexByProtocol)(_types.Swap.Protocol.Unsupported)).toBe(_types.Swap.Dex.Unsupported);
});
it('should return Unsupported for Cerra and Genius protocols', () => {
expect((0, _getDexByProtocol.getDexByProtocol)(_types.Swap.Protocol.Cerra)).toBe(_types.Swap.Dex.Unsupported);
expect((0, _getDexByProtocol.getDexByProtocol)(_types.Swap.Protocol.Genius)).toBe(_types.Swap.Dex.Unsupported);
});
it('should return Unsupported for invalid protocol', () => {
// Test the default case in the switch statement (line 4)
expect((0, _getDexByProtocol.getDexByProtocol)('invalid-protocol')).toBe(_types.Swap.Dex.Unsupported);
});
});
//# sourceMappingURL=getDexByProtocol.test.js.map