From c7db2844f5f2b3bbf8e76d6b697e91e4674e5473 Mon Sep 17 00:00:00 2001 From: Diego Garcia Date: Tue, 26 Sep 2017 12:16:19 +0200 Subject: [PATCH] Add descriptions for dynamic tests --- test/unit/helpers/wsApi.js | 7 ++++++- test/unit/index.js | 2 +- test/unit/logic/delegate.js | 8 ++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/test/unit/helpers/wsApi.js b/test/unit/helpers/wsApi.js index 91e0c0d2324..dec3e40f2fd 100644 --- a/test/unit/helpers/wsApi.js +++ b/test/unit/helpers/wsApi.js @@ -90,7 +90,7 @@ describe('handshake', function () { height: 1 }; - describe('schema', function () { + describe('schema dynamic tests: handshake wsApi', function () { var schemaDynamicTests = new SchemaDynamicTests({ customArgumentAssertion: function (input, expectedType, err) { @@ -110,22 +110,27 @@ describe('handshake', function () { schemaDynamicTests.schema.shouldFailAgainst.nonObject.arguments(handshake); describe('nonce', function () { + schemaDynamicTests.schema.shouldFailAgainst.nonString.property(handshake, validHeaders, 'nonce'); }); describe('height', function () { + schemaDynamicTests.schema.shouldFailAgainst.nonInteger.property(handshake, validHeaders, 'height'); }); describe('nethash', function () { + schemaDynamicTests.schema.shouldFailAgainst.nonString.property(handshake, validHeaders, 'nethash'); }); describe('version', function () { + schemaDynamicTests.schema.shouldFailAgainst.nonString.property(handshake, validHeaders, 'version'); }); describe('required properties', function () { + schemaDynamicTests.schema.shouldFailWithoutRequiredProperties(handshake, validHeaders, ['port', 'version', 'nonce', 'nethash', 'height']); }); }); diff --git a/test/unit/index.js b/test/unit/index.js index d1897b275fd..92ea3adae34 100644 --- a/test/unit/index.js +++ b/test/unit/index.js @@ -13,6 +13,7 @@ require('./helpers/wsApi'); require('./helpers/z_schema'); require('./logic/account'); +require('./logic/delegate'); require('./logic/peer'); require('./logic/peers'); require('./logic/multisignature'); @@ -39,5 +40,4 @@ require('./schema/delegates'); // with long timeouts require('./helpers/pg-notify'); require('./logic/blockReward'); -require('./logic/delegate'); require('./sql/blockRewards'); diff --git a/test/unit/logic/delegate.js b/test/unit/logic/delegate.js index f833a8db864..378ee161e7b 100644 --- a/test/unit/logic/delegate.js +++ b/test/unit/logic/delegate.js @@ -449,10 +449,14 @@ describe('delegate', function () { }); after(function () { - describe('schema dynamic tests', function () { + describe('schema dynamic tests: delegate', function () { + schemaDynamicTest.schema.shouldFailAgainst.nonObject.property(delegate.objectNormalize, trs, 'asset.delegate'); - schemaDynamicTest.schema.shouldFailAgainst.nonString.property(delegate.objectNormalize, trs, 'asset.delegate.username'); + describe('username', function () { + + schemaDynamicTest.schema.shouldFailAgainst.nonString.property(delegate.objectNormalize, trs, 'asset.delegate.username'); + }); }); });