diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-24 23:46:58 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-24 23:46:58 +0800 |
commit | 38f47a380b663df0a3f817100650e222dd7582e0 (patch) | |
tree | 23348daa23207b840b93335bfb823d451053ab53 /packages/json-schemas/test/schema_test.ts | |
parent | 4c4286ac662d3dba928bf16b83ade5e5476f4614 (diff) | |
parent | 8635f8d7325d472dd7d4fac26f1a87bee17edd1a (diff) | |
download | dexon-sol-tools-38f47a380b663df0a3f817100650e222dd7582e0.tar dexon-sol-tools-38f47a380b663df0a3f817100650e222dd7582e0.tar.gz dexon-sol-tools-38f47a380b663df0a3f817100650e222dd7582e0.tar.bz2 dexon-sol-tools-38f47a380b663df0a3f817100650e222dd7582e0.tar.lz dexon-sol-tools-38f47a380b663df0a3f817100650e222dd7582e0.tar.xz dexon-sol-tools-38f47a380b663df0a3f817100650e222dd7582e0.tar.zst dexon-sol-tools-38f47a380b663df0a3f817100650e222dd7582e0.zip |
Merge branch 'development' into feature/instant/processing-state
Diffstat (limited to 'packages/json-schemas/test/schema_test.ts')
-rw-r--r-- | packages/json-schemas/test/schema_test.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/json-schemas/test/schema_test.ts b/packages/json-schemas/test/schema_test.ts index 795261ef2..bfa2c5668 100644 --- a/packages/json-schemas/test/schema_test.ts +++ b/packages/json-schemas/test/schema_test.ts @@ -36,6 +36,7 @@ const { relayerApiOrdersChannelUpdateSchema, relayerApiOrdersResponseSchema, relayerApiOrderSchema, + wholeNumberSchema, } = schemas; describe('Schema', () => { @@ -73,6 +74,17 @@ describe('Schema', () => { validateAgainstSchema(testCases, numberSchema, shouldFail); }); }); + describe('#wholeNumberSchema', () => { + it('should validate valid numbers', () => { + const testCases = ['5', '42', '0']; + validateAgainstSchema(testCases, wholeNumberSchema); + }); + it('should fail for invalid numbers', () => { + const testCases = ['1.3', '0.2', '00.00', '.3', '1.', 'abacaba', 'и', '1..0']; + const shouldFail = true; + validateAgainstSchema(testCases, wholeNumberSchema, shouldFail); + }); + }); describe('#addressSchema', () => { it('should validate valid addresses', () => { const testCases = ['0x8b0292b11a196601ed2ce54b665cafeca0347d42', NULL_ADDRESS]; |