diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-08-02 04:34:10 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-08-02 04:34:10 +0800 |
commit | 48aaf228558ae7312d314a0c1f5bd920428eb39d (patch) | |
tree | 0095b221ff0723fd459f3c4464e33de405a6ed61 /packages | |
parent | 8351f5998ab3960461b255826778ff279991c184 (diff) | |
download | dexon-sol-tools-48aaf228558ae7312d314a0c1f5bd920428eb39d.tar.gz dexon-sol-tools-48aaf228558ae7312d314a0c1f5bd920428eb39d.tar.zst dexon-sol-tools-48aaf228558ae7312d314a0c1f5bd920428eb39d.zip |
Update order book schema test
Diffstat (limited to 'packages')
-rw-r--r-- | packages/json-schemas/test/schema_test.ts | 61 |
1 files changed, 43 insertions, 18 deletions
diff --git a/packages/json-schemas/test/schema_test.ts b/packages/json-schemas/test/schema_test.ts index 119c13388..7b090ad87 100644 --- a/packages/json-schemas/test/schema_test.ts +++ b/packages/json-schemas/test/schema_test.ts @@ -626,20 +626,34 @@ describe('Schema', () => { it('should validate valid order book responses', () => { const testCases = [ { - bids: [], - asks: [], - }, - { - bids: [signedOrder, signedOrder], - asks: [], + bids: { + ...paginatedResponse, + records: [relayerApiOrder], + }, + asks: { + ...paginatedResponse, + records: [], + }, }, { - bids: [], - asks: [signedOrder, signedOrder], + bids: { + ...paginatedResponse, + records: [relayerApiOrder, relayerApiOrder], + }, + asks: { + ...paginatedResponse, + records: [relayerApiOrder, relayerApiOrder], + }, }, { - bids: [signedOrder], - asks: [signedOrder, signedOrder], + bids: { + ...paginatedResponse, + records: [], + }, + asks: { + ...paginatedResponse, + records: [relayerApiOrder, relayerApiOrder], + }, }, ]; validateAgainstSchema(testCases, relayerApiOrderBookResponseSchema); @@ -648,18 +662,29 @@ describe('Schema', () => { const testCases = [ {}, { - bids: [signedOrder, signedOrder], - }, - { - asks: [signedOrder, signedOrder], + bids: { + records: [relayerApiOrder], + }, + asks: { + ...paginatedResponse, + records: [], + }, }, { - bids: signedOrder, - asks: [signedOrder, signedOrder], + bids: { + ...paginatedResponse, + records: [relayerApiOrder, relayerApiOrder], + }, + asks: {}, }, { - bids: [signedOrder], - asks: signedOrder, + bids: { + ...paginatedResponse, + }, + asks: { + ...paginatedResponse, + records: [relayerApiOrder, relayerApiOrder], + }, }, ]; const shouldFail = true; |