From 5c4f6802b3845dc7afc52927bfb55d7a55ae8739 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sun, 9 May 2021 21:23:32 -0700 Subject: [PATCH] Ensured integration tests pass for abc and bchn --- test/v4/slp.js | 114 +++++++++++++++++++++++++------------------------ 1 file changed, 59 insertions(+), 55 deletions(-) diff --git a/test/v4/slp.js b/test/v4/slp.js index 9f4d403..3cb48e5 100644 --- a/test/v4/slp.js +++ b/test/v4/slp.js @@ -1863,41 +1863,43 @@ describe('#SLP', () => { }) } - it('should get NFT children IDs in given NFT group', async () => { - if (process.env.TEST === 'unit') { - sandbox.stub(slpRoute, 'lookupToken').resolves(mockData.mockNftGroup) - sandbox.stub(slpRoute.axios, 'request').resolves({ - data: { - t: [ - { - tokenDetails: mockData.mockNftChildren[0], - nftParentId: mockData.mockNftGroup.id - }, - { - tokenDetails: mockData.mockNftChildren[1], - nftParentId: mockData.mockNftGroup.id - } - ] - } - }) - } + if (process.env.ISBCHN) { + it('should get NFT children IDs in given NFT group', async () => { + if (process.env.TEST === 'unit') { + sandbox.stub(slpRoute, 'lookupToken').resolves(mockData.mockNftGroup) + sandbox.stub(slpRoute.axios, 'request').resolves({ + data: { + t: [ + { + tokenDetails: mockData.mockNftChildren[0], + nftParentId: mockData.mockNftGroup.id + }, + { + tokenDetails: mockData.mockNftChildren[1], + nftParentId: mockData.mockNftGroup.id + } + ] + } + }) + } - req.params.tokenId = - '68cd33ecd909068fbea318ae5ff1d6207cf754e53b191327d6d73b6916424c0a' + req.params.tokenId = + '68cd33ecd909068fbea318ae5ff1d6207cf754e53b191327d6d73b6916424c0a' - const result = await slpRoute.getNftChildren(req, res) - // console.log(`result: ${JSON.stringify(result, null, 2)}`) - assert.isArray(result.nftChildren) - assert.equal(result.nftChildren.length, 2) - assert.equal( - result.nftChildren[0], - '45a30085691d6ea586e3ec2aa9122e9b0e0d6c3c1fd357decccc15d8efde48a9' - ) - assert.equal( - result.nftChildren[1], - '928ce61fe1006b1325a0ba0dce700bf83986a6f0691ba26e121c9ac035d12a55' - ) - }) + const result = await slpRoute.getNftChildren(req, res) + // console.log(`result: ${JSON.stringify(result, null, 2)}`) + assert.isArray(result.nftChildren) + assert.equal(result.nftChildren.length, 2) + assert.equal( + result.nftChildren[0], + '45a30085691d6ea586e3ec2aa9122e9b0e0d6c3c1fd357decccc15d8efde48a9' + ) + assert.equal( + result.nftChildren[1], + '928ce61fe1006b1325a0ba0dce700bf83986a6f0691ba26e121c9ac035d12a55' + ) + }) + } }) describe('#getNftGroup', () => { @@ -2003,29 +2005,31 @@ describe('#SLP', () => { }) } - it('should get NFT group information for tokenId', async () => { - req.params.tokenId = - '45a30085691d6ea586e3ec2aa9122e9b0e0d6c3c1fd357decccc15d8efde48a9' + if (process.env.ISBCHN) { + it('should get NFT group information for tokenId', async () => { + req.params.tokenId = + '45a30085691d6ea586e3ec2aa9122e9b0e0d6c3c1fd357decccc15d8efde48a9' - if (process.env.TEST === 'unit') { - const callback = sandbox.stub(slpRoute, 'lookupToken') - callback - .withArgs(req.params.tokenId) - .resolves(mockData.mockNftChildren[0]) - callback - .withArgs(mockData.mockNftGroup.id) - .resolves(mockData.mockNftGroup) - } - const result = await slpRoute.getNftGroup(req, res) - // console.log(`result: ${JSON.stringify(result, null, 2)}`) - assert.property(result, 'nftGroup') - assert.property(result.nftGroup, 'id') - assert.equal(result.nftGroup.id, mockData.mockNftGroup.id) - assert.property(result.nftGroup, 'versionType') - assert.equal(result.nftGroup.versionType, 129) - assert.property(result.nftGroup, 'symbol') - assert.property(result.nftGroup, 'initialTokenQty') - }) + if (process.env.TEST === 'unit') { + const callback = sandbox.stub(slpRoute, 'lookupToken') + callback + .withArgs(req.params.tokenId) + .resolves(mockData.mockNftChildren[0]) + callback + .withArgs(mockData.mockNftGroup.id) + .resolves(mockData.mockNftGroup) + } + const result = await slpRoute.getNftGroup(req, res) + // console.log(`result: ${JSON.stringify(result, null, 2)}`) + assert.property(result, 'nftGroup') + assert.property(result.nftGroup, 'id') + assert.equal(result.nftGroup.id, mockData.mockNftGroup.id) + assert.property(result.nftGroup, 'versionType') + assert.equal(result.nftGroup.versionType, 129) + assert.property(result.nftGroup, 'symbol') + assert.property(result.nftGroup, 'initialTokenQty') + }) + } }) })