From 9aefdbf6bed0dff113815826c4ed9a5d5d58fa3f Mon Sep 17 00:00:00 2001 From: TRBC Date: Thu, 12 Nov 2020 04:14:51 -0400 Subject: [PATCH] mock array in test address details --- test/unit/ninsight.js | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/test/unit/ninsight.js b/test/unit/ninsight.js index 331ec9f..011c1c8 100644 --- a/test/unit/ninsight.js +++ b/test/unit/ninsight.js @@ -285,38 +285,38 @@ describe(`#Ninsight`, () => { } }) - it(`should GET details for a single address`, async () => { + it(`should POST address details for a single address`, async () => { // Stub the network call. sandbox.stub(axios, "post").resolves({ - data: mockData.addrDetail + data: mockData.addrDetailArray }) const result = await bchjs.Ninsight.details("addr") //console.log(`result: ${JSON.stringify(result, null, 2)}`) - assert.property(result, "balance") - assert.property(result, "balanceSat") - assert.property(result, "totalReceived") - assert.property(result, "totalReceivedSat") - assert.property(result, "totalSent") - assert.property(result, "totalSentSat") - assert.property(result, "unconfirmedBalance") - assert.property(result, "unconfirmedBalanceSat") - assert.property(result, "unconfirmedTxApperances") - assert.property(result, "txApperances") - assert.property(result, "transactions") - assert.property(result, "legacyAddress") - assert.property(result, "cashAddress") - assert.property(result, "slpAddress") - assert.property(result, "currentPage") - assert.property(result, "pagesTotal") + assert.property(result[0], "balance") + assert.property(result[0], "balanceSat") + assert.property(result[0], "totalReceived") + assert.property(result[0], "totalReceivedSat") + assert.property(result[0], "totalSent") + assert.property(result[0], "totalSentSat") + assert.property(result[0], "unconfirmedBalance") + assert.property(result[0], "unconfirmedBalanceSat") + assert.property(result[0], "unconfirmedTxApperances") + assert.property(result[0], "txApperances") + assert.property(result[0], "transactions") + assert.property(result[0], "legacyAddress") + assert.property(result[0], "cashAddress") + assert.property(result[0], "slpAddress") + assert.property(result[0], "currentPage") + assert.property(result[0], "pagesTotal") }) it(`should call constructor with null args`, async () => { new bchjs.Ninsight.constructor({}) }) - it(`should GET details for an array of addresses`, async () => { + it(`should POST address details for an array of addresses`, async () => { // Mock the network call. sandbox.stub(axios, "post").resolves({ data: mockData.addrDetailArray