mirror of
https://github.com/fullstack-cash/bch-api.git
synced 2026-09-21 16:52:04 -07:00
Ensured integration tests pass for abc and bchn
This commit is contained in:
+59
-55
@@ -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')
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user