Skip to content

Commit

Permalink
add withMint=True and delete sell test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcos20 committed Nov 21, 2023
1 parent 52905da commit 48eb4a2
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions test/integration/users.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ describe('User tests', async () => {
fixedRate: price,
marketFee: publishMarketSwapFee,
allowedConsumer: ZERO_ADDRESS,
withMint: false
withMint: true
}

const result = await Factory.createNftWithDatatokenWithFixedRate(
Expand Down Expand Up @@ -196,27 +196,6 @@ describe('User tests', async () => {
assert(user.totalSales === '0', 'incorrect value for: totalSales')
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 () => {
// Start with publishing a new datatoken
const nftParams: NftCreateData = {
Expand Down

0 comments on commit 48eb4a2

Please sign in to comment.