mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-11 03:26:14 +00:00
Merge branch 'feat/send-page' into wallet-decrypt
This commit is contained in:
commit
dbb90d0d5c
@ -1,34 +0,0 @@
|
||||
import Validator from '../../common/libs/validator';
|
||||
import { DONATION_ADDRESSES_MAP } from '../../common/config/data';
|
||||
|
||||
describe('Validator', () => {
|
||||
it('should validate correct BTC address as true', () => {
|
||||
const validator = new Validator();
|
||||
expect(
|
||||
validator.isValidBTCAddress(DONATION_ADDRESSES_MAP.BTC)
|
||||
).toBeTruthy();
|
||||
});
|
||||
it('should validate incorrect BTC address as false', () => {
|
||||
const validator = new Validator();
|
||||
expect(
|
||||
validator.isValidBTCAddress(
|
||||
'nonsense' + DONATION_ADDRESSES_MAP.BTC + 'nonsense'
|
||||
)
|
||||
).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should validate correct ETH address as true', () => {
|
||||
const validator = new Validator();
|
||||
expect(
|
||||
validator.isValidETHAddress(DONATION_ADDRESSES_MAP.ETH)
|
||||
).toBeTruthy();
|
||||
});
|
||||
it('should validate incorrect ETH address as false', () => {
|
||||
const validator = new Validator();
|
||||
expect(
|
||||
validator.isValidETHAddress(
|
||||
'nonsense' + DONATION_ADDRESSES_MAP.ETH + 'nonsense'
|
||||
)
|
||||
).toBeFalsy();
|
||||
});
|
||||
});
|
18
spec/libs/validators.spec.js
Normal file
18
spec/libs/validators.spec.js
Normal file
@ -0,0 +1,18 @@
|
||||
import { isValidBTCAddress, isValidETHAddress } from '../../common/libs/validators';
|
||||
import { DONATION_ADDRESSES_MAP } from '../../common/config/data';
|
||||
|
||||
describe('Validator', () => {
|
||||
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();
|
||||
});
|
||||
|
||||
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();
|
||||
});
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user