2017-07-02 00:49:06 -05:00
|
|
|
import {
|
|
|
|
isValidBTCAddress,
|
|
|
|
isValidETHAddress
|
|
|
|
} from '../../common/libs/validators';
|
2017-06-27 03:38:45 +04:00
|
|
|
import { DONATION_ADDRESSES_MAP } from '../../common/config/data';
|
|
|
|
|
|
|
|
describe('Validator', () => {
|
2017-07-02 00:49:06 -05:00
|
|
|
it('should validate correct BTC address as true', () => {
|
|
|
|
expect(isValidBTCAddress(DONATION_ADDRESSES_MAP.BTC)).toBeTruthy();
|
|
|
|
});
|
|
|
|
it('should validate incorrect BTC address as false', () => {
|
|
|
|
expect(
|
|
|
|
isValidBTCAddress('nonsense' + DONATION_ADDRESSES_MAP.BTC + 'nonsense')
|
|
|
|
).toBeFalsy();
|
|
|
|
});
|
2017-06-27 03:38:45 +04:00
|
|
|
|
2017-07-02 00:49:06 -05:00
|
|
|
it('should validate correct ETH address as true', () => {
|
|
|
|
expect(isValidETHAddress(DONATION_ADDRESSES_MAP.ETH)).toBeTruthy();
|
|
|
|
});
|
|
|
|
it('should validate incorrect ETH address as false', () => {
|
|
|
|
expect(
|
|
|
|
isValidETHAddress('nonsense' + DONATION_ADDRESSES_MAP.ETH + 'nonsense')
|
|
|
|
).toBeFalsy();
|
|
|
|
});
|
2017-06-27 03:38:45 +04:00
|
|
|
});
|