mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-19 19:55:51 +00:00
[FIX] Handle invalid input in parse_human
This commit is contained in:
@@ -120,6 +120,12 @@ describe('Amount', function() {
|
||||
});
|
||||
});
|
||||
describe('from_human', function() {
|
||||
it('empty string', function() {
|
||||
assert.strictEqual(Amount.from_human('').to_text_full(), 'NaN');
|
||||
});
|
||||
it('missing value', function() {
|
||||
assert.strictEqual(Amount.from_human('USD').to_text_full(), 'NaN');
|
||||
});
|
||||
it('1 XRP', function() {
|
||||
assert.strictEqual(Amount.from_human("1 XRP").to_text_full(), '1/XRP');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user