UNPKG

@yoroi/portfolio

Version:

The Portfolio package of Yoroi SDK

28 lines (27 loc) 1.23 kB
"use strict"; var _tokenInfo = require("../adapters/token-info.mocks"); var _constants = require("../constants"); var _isPrimaryToken = require("./is-primary-token"); describe('isPrimary', () => { it('should return true if the token nature is Primary', () => { const result = (0, _isPrimaryToken.isPrimaryToken)(_tokenInfo.tokenInfoMocks.primaryETH); expect(result).toBe(true); }); it('should return false if the token nature is not Primary', () => { const result = (0, _isPrimaryToken.isPrimaryToken)(_tokenInfo.tokenInfoMocks.nftCryptoKitty); expect(result).toBe(false); }); it('should return true if the token id is the primary token id', () => { const result = (0, _isPrimaryToken.isPrimaryToken)(_constants.primaryTokenId); expect(result).toBe(true); }); it('should return false if the token id is not the primary token id', () => { const result = (0, _isPrimaryToken.isPrimaryToken)(_tokenInfo.tokenInfoMocks.nftCryptoKitty.id); expect(result).toBe(false); }); it('should return false if the token id is present', () => { const result = (0, _isPrimaryToken.isPrimaryToken)(null); expect(result).toBe(false); }); }); //# sourceMappingURL=is-primary-token.test.js.map