UNPKG

@yoroi/portfolio

Version:

The Portfolio package of Yoroi SDK

33 lines (32 loc) 1.42 kB
"use strict"; var _types = require("@yoroi/types"); var _tokenNature = require("./token-nature"); describe('isTokenNature', () => { it('should return true for valid token nature', () => { const validTokenNature = _types.Portfolio.Token.Nature.Primary; expect((0, _tokenNature.isTokenNature)(validTokenNature)).toBe(true); }); it('should return false for invalid token nature', () => { const invalidTokenNature = 'InvalidTokenNature'; expect((0, _tokenNature.isTokenNature)(invalidTokenNature)).toBe(false); }); it('should return false for undefined', () => { const undefinedTokenNature = undefined; expect((0, _tokenNature.isTokenNature)(undefinedTokenNature)).toBe(false); }); }); describe('parseTokenNature', () => { it('should return valid token nature', () => { const validTokenNature = _types.Portfolio.Token.Nature.Primary; expect((0, _tokenNature.parseTokenNature)(validTokenNature)).toBe(validTokenNature); }); it('should return undefined for invalid token nature', () => { const invalidTokenNature = 'InvalidTokenNature'; expect((0, _tokenNature.parseTokenNature)(invalidTokenNature)).toBeUndefined(); }); it('should return undefined for undefined', () => { const undefinedTokenNature = undefined; expect((0, _tokenNature.parseTokenNature)(undefinedTokenNature)).toBeUndefined(); }); }); //# sourceMappingURL=token-nature.test.js.map