1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-04 14:18:12 +00:00
trezor-wallet/src/utils/__tests__/cryptoUriParser.test.js
2019-03-04 13:33:02 +01:00

19 lines
768 B
JavaScript

import * as utils from '../cryptoUriParser';
describe('crypto uri parser', () => {
it('parseUri', () => {
expect(utils.parseUri('http://www.trezor.io')).toEqual({ address: '//www.trezor.io' }); // TODO: Error in function
expect(utils.parseUri('www.trezor.io')).toEqual({ address: 'www.trezor.io' });
expect(utils.parseUri('www.trezor.io/TT')).toEqual({ address: 'www.trezor.io/TT' });
expect(utils.parseUri('www.trezor.io/TT?param1=aha')).toEqual({
address: 'www.trezor.io/TT',
param1: 'aha',
});
expect(utils.parseUri('www.trezor.io/TT?param1=aha&param2=hah')).toEqual({
address: 'www.trezor.io/TT',
param1: 'aha',
param2: 'hah',
});
});
});