add withMint=True and delete sell test
This commit is contained in:
parent
52905dacc4
commit
48eb4a2324
|
@ -123,7 +123,7 @@ describe('User tests', async () => {
|
||||||
fixedRate: price,
|
fixedRate: price,
|
||||||
marketFee: publishMarketSwapFee,
|
marketFee: publishMarketSwapFee,
|
||||||
allowedConsumer: ZERO_ADDRESS,
|
allowedConsumer: ZERO_ADDRESS,
|
||||||
withMint: false
|
withMint: true
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await Factory.createNftWithDatatokenWithFixedRate(
|
const result = await Factory.createNftWithDatatokenWithFixedRate(
|
||||||
|
@ -196,27 +196,6 @@ describe('User tests', async () => {
|
||||||
assert(user.totalSales === '0', 'incorrect value for: totalSales')
|
assert(user.totalSales === '0', 'incorrect value for: totalSales')
|
||||||
assert(user.__typename === 'User', 'incorrect value for: __typename')
|
assert(user.__typename === 'User', 'incorrect value for: __typename')
|
||||||
})
|
})
|
||||||
it('User1 sells a datatoken', async () => {
|
|
||||||
const initialUser = await userQuery(user1)
|
|
||||||
await datatoken.approve(datatokenAddress, fixedRateAddress, dtAmount, user1)
|
|
||||||
const tx = (await fixedRate.sellDatatokens(user1, exchangeId, '10', '9'))
|
|
||||||
.events?.Swapped
|
|
||||||
|
|
||||||
assert(tx != null)
|
|
||||||
const user = await userQuery(user1)
|
|
||||||
|
|
||||||
assert(user.id === user1, 'incorrect value for: id')
|
|
||||||
assert(user.tokenBalancesOwned.length === 0, 'incorrect tokenBalancesOwned')
|
|
||||||
assert(user.orders.length === 0, 'incorrect value for: orders')
|
|
||||||
assert(
|
|
||||||
user.freSwaps.length === initialUser.freSwaps.length,
|
|
||||||
'incorrect value for: freSwaps'
|
|
||||||
)
|
|
||||||
assert(user.totalOrders === '0', 'incorrect value for: totalOrders')
|
|
||||||
assert(user.totalSales === '0', 'incorrect value for: totalSales')
|
|
||||||
assert(user.__typename === 'User', 'incorrect value for: __typename')
|
|
||||||
})
|
|
||||||
|
|
||||||
it('Check user fields after publishing & ordering a datatoken', async () => {
|
it('Check user fields after publishing & ordering a datatoken', async () => {
|
||||||
// Start with publishing a new datatoken
|
// Start with publishing a new datatoken
|
||||||
const nftParams: NftCreateData = {
|
const nftParams: NftCreateData = {
|
||||||
|
|
Loading…
Reference in New Issue