mirror of
https://github.com/oceanprotocol/ocean-subgraph.git
synced 2024-12-02 05:57:29 +01:00
Fixing tests with nft.owner and nft.creator
This commit is contained in:
parent
a40997f006
commit
1bf645541f
@ -125,8 +125,8 @@ describe('Dispenser tests', async () => {
|
|||||||
symbol,
|
symbol,
|
||||||
name,
|
name,
|
||||||
tokenUri,
|
tokenUri,
|
||||||
owner,
|
owner{id},
|
||||||
creator,
|
creator{id},
|
||||||
address,
|
address,
|
||||||
providerUrl,
|
providerUrl,
|
||||||
assetState,
|
assetState,
|
||||||
@ -153,8 +153,8 @@ describe('Dispenser tests', async () => {
|
|||||||
assert(nft.symbol === nftSymbol, 'incorrect value for: symbol')
|
assert(nft.symbol === nftSymbol, 'incorrect value for: symbol')
|
||||||
assert(nft.name === nftName, 'incorrect value for: name')
|
assert(nft.name === nftName, 'incorrect value for: name')
|
||||||
assert(nft.tokenUri === tokenURI, 'incorrect value for: tokenUri')
|
assert(nft.tokenUri === tokenURI, 'incorrect value for: tokenUri')
|
||||||
assert(nft.owner === publisher, 'incorrect value for: owner')
|
assert(nft.owner.id === publisher, 'incorrect value for: owner')
|
||||||
assert(nft.creator === publisher, 'incorrect value for: creator')
|
assert(nft.creator.id === publisher, 'incorrect value for: creator')
|
||||||
assert(nft.managerRole[0] === publisher, 'incorrect value for: managerRole')
|
assert(nft.managerRole[0] === publisher, 'incorrect value for: managerRole')
|
||||||
assert(
|
assert(
|
||||||
nft.erc20DeployerRole[0] === factoryAddress,
|
nft.erc20DeployerRole[0] === factoryAddress,
|
||||||
|
@ -138,8 +138,8 @@ describe('Fixed Rate Exchange tests', async () => {
|
|||||||
symbol,
|
symbol,
|
||||||
name,
|
name,
|
||||||
tokenUri,
|
tokenUri,
|
||||||
owner,
|
owner{id},
|
||||||
creator,
|
creator{id},
|
||||||
address,
|
address,
|
||||||
providerUrl,
|
providerUrl,
|
||||||
assetState,
|
assetState,
|
||||||
@ -166,8 +166,8 @@ describe('Fixed Rate Exchange tests', async () => {
|
|||||||
assert(nft.symbol === nftSymbol, 'incorrect value for: symbol')
|
assert(nft.symbol === nftSymbol, 'incorrect value for: symbol')
|
||||||
assert(nft.name === nftName, 'incorrect value for: name')
|
assert(nft.name === nftName, 'incorrect value for: name')
|
||||||
assert(nft.tokenUri === tokenURI, 'incorrect value for: tokenUri')
|
assert(nft.tokenUri === tokenURI, 'incorrect value for: tokenUri')
|
||||||
assert(nft.owner === publisher, 'incorrect value for: owner')
|
assert(nft.owner.id === publisher, 'incorrect value for: owner')
|
||||||
assert(nft.creator === publisher, 'incorrect value for: creator')
|
assert(nft.creator.id === publisher, 'incorrect value for: creator')
|
||||||
assert(nft.managerRole[0] === publisher, 'incorrect value for: managerRole')
|
assert(nft.managerRole[0] === publisher, 'incorrect value for: managerRole')
|
||||||
assert(
|
assert(
|
||||||
nft.erc20DeployerRole[0] === factoryAddress,
|
nft.erc20DeployerRole[0] === factoryAddress,
|
||||||
|
@ -130,8 +130,8 @@ describe('NFT tests', async () => {
|
|||||||
symbol,
|
symbol,
|
||||||
name,
|
name,
|
||||||
tokenUri,
|
tokenUri,
|
||||||
owner,
|
owner{id},
|
||||||
creator,
|
creator{id},
|
||||||
address,
|
address,
|
||||||
providerUrl,
|
providerUrl,
|
||||||
assetState,
|
assetState,
|
||||||
@ -157,8 +157,8 @@ describe('NFT tests', async () => {
|
|||||||
assert(nft.symbol === nftSymbol, 'incorrect value for: symbol')
|
assert(nft.symbol === nftSymbol, 'incorrect value for: symbol')
|
||||||
assert(nft.name === nftName, 'incorrect value for: name')
|
assert(nft.name === nftName, 'incorrect value for: name')
|
||||||
assert(nft.tokenUri === tokenURI, 'incorrect value for: tokenUri')
|
assert(nft.tokenUri === tokenURI, 'incorrect value for: tokenUri')
|
||||||
assert(nft.owner === publisher, 'incorrect value for: owner')
|
assert(nft.owner.id === publisher, 'incorrect value for: owner')
|
||||||
assert(nft.creator === publisher, 'incorrect value for: creator')
|
assert(nft.creator.id === publisher, 'incorrect value for: creator')
|
||||||
assert(nft.managerRole[0] === publisher, 'incorrect value for: managerRole')
|
assert(nft.managerRole[0] === publisher, 'incorrect value for: managerRole')
|
||||||
assert(
|
assert(
|
||||||
nft.erc20DeployerRole[0] === factoryAddress,
|
nft.erc20DeployerRole[0] === factoryAddress,
|
||||||
@ -219,8 +219,8 @@ describe('NFT tests', async () => {
|
|||||||
symbol,
|
symbol,
|
||||||
name,
|
name,
|
||||||
tokenUri,
|
tokenUri,
|
||||||
owner,
|
owner{id},
|
||||||
creator,
|
creator{id},
|
||||||
address,
|
address,
|
||||||
providerUrl,
|
providerUrl,
|
||||||
assetState,
|
assetState,
|
||||||
@ -247,8 +247,8 @@ describe('NFT tests', async () => {
|
|||||||
assert(updatedNft.symbol === nftSymbol, 'incorrect value for: symbol')
|
assert(updatedNft.symbol === nftSymbol, 'incorrect value for: symbol')
|
||||||
assert(updatedNft.name === nftName, 'incorrect value for: name')
|
assert(updatedNft.name === nftName, 'incorrect value for: name')
|
||||||
assert(updatedNft.tokenUri === tokenURI, 'incorrect value for: tokenUri')
|
assert(updatedNft.tokenUri === tokenURI, 'incorrect value for: tokenUri')
|
||||||
assert(updatedNft.owner === publisher, 'incorrect value for: owner')
|
assert(updatedNft.owner.id === publisher, 'incorrect value for: owner')
|
||||||
assert(updatedNft.creator === publisher, 'incorrect value for: creator')
|
assert(updatedNft.creator.id === publisher, 'incorrect value for: creator')
|
||||||
assert(
|
assert(
|
||||||
updatedNft.managerRole[0] === publisher,
|
updatedNft.managerRole[0] === publisher,
|
||||||
'incorrect value for: managerRole'
|
'incorrect value for: managerRole'
|
||||||
|
@ -191,7 +191,7 @@ describe('Simple Publish & consume test', async () => {
|
|||||||
|
|
||||||
const queryOriginalOwner = {
|
const queryOriginalOwner = {
|
||||||
query: `query {
|
query: `query {
|
||||||
nft(id:"${graphNftToken}"){symbol,id,owner}}`
|
nft(id:"${graphNftToken}"){symbol,id,owner{id}}}`
|
||||||
}
|
}
|
||||||
const initialResponse = await fetch(subgraphUrl, {
|
const initialResponse = await fetch(subgraphUrl, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -200,7 +200,7 @@ describe('Simple Publish & consume test', async () => {
|
|||||||
const initialResult = await initialResponse.json()
|
const initialResult = await initialResponse.json()
|
||||||
// Checking original owner account has been set correctly
|
// Checking original owner account has been set correctly
|
||||||
assert(
|
assert(
|
||||||
initialResult.data.nft.owner.toLowerCase() ===
|
initialResult.data.nft.owner.id.toLowerCase() ===
|
||||||
publisherAccount.toLowerCase()
|
publisherAccount.toLowerCase()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -235,14 +235,14 @@ describe('Simple Publish & consume test', async () => {
|
|||||||
await sleep(2000)
|
await sleep(2000)
|
||||||
const query2 = {
|
const query2 = {
|
||||||
query: `query {
|
query: `query {
|
||||||
nft(id:"${graphNftToken}"){symbol,id,owner, transferable}}`
|
nft(id:"${graphNftToken}"){symbol,id,owner{id}, transferable}}`
|
||||||
}
|
}
|
||||||
const response = await fetch(subgraphUrl, {
|
const response = await fetch(subgraphUrl, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(query2)
|
body: JSON.stringify(query2)
|
||||||
})
|
})
|
||||||
const queryResult = await response.json()
|
const queryResult = await response.json()
|
||||||
assert(queryResult.data.nft.owner === newOwnerAccount)
|
assert(queryResult.data.nft.owner.id === newOwnerAccount)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should save provider fees after startOrder is called', async () => {
|
it('should save provider fees after startOrder is called', async () => {
|
||||||
|
@ -112,13 +112,13 @@ describe('Tests coverage without provider/aquarius', async () => {
|
|||||||
await sleep(2000)
|
await sleep(2000)
|
||||||
const query2 = {
|
const query2 = {
|
||||||
query: `query {
|
query: `query {
|
||||||
nft(id:"${graphNftToken}"){symbol,id,owner, transferable}}`
|
nft(id:"${graphNftToken}"){symbol,id,owner{id}, transferable}}`
|
||||||
}
|
}
|
||||||
const response = await fetch(subgraphUrl, {
|
const response = await fetch(subgraphUrl, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(query2)
|
body: JSON.stringify(query2)
|
||||||
})
|
})
|
||||||
const queryResult = await response.json()
|
const queryResult = await response.json()
|
||||||
assert(queryResult.data.nft.owner === newOwnerAccount)
|
assert(queryResult.data.nft.owner.id === newOwnerAccount)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user