difftreelog
test nesting under non-existing token
in: master
1 file changed
tests/src/sub/nesting/common.test.tsdiffbeforeafterboth122 await expect(collectionForNesting.transfer(alice, targetToken.nestingAccount(), 50n)).to.be.rejectedWith('common.UserIsNotAllowedToNest');122 await expect(collectionForNesting.transfer(alice, targetToken.nestingAccount(), 50n)).to.be.rejectedWith('common.UserIsNotAllowedToNest');123 });123 });124125 itSub('Cannot nest to a future collection', async ({helper}) => {126 const nonExistingCollectionId = await helper.collection.getTotalCount() + 1000;127 const futureToken = helper.nft.getTokenObject(nonExistingCollectionId, 1);128129 const nftCollectionForNesting = await helper.nft.mintCollection(alice);130 const rftCollectionForNesting = await helper.rft.mintCollection(alice);131 const ftCollectionForNesting = await helper.ft.mintCollection(alice);132133 // 1. Alice cannot create nested token to future token134 await expect(nftCollectionForNesting.mintToken(alice, futureToken.nestingAccount())).to.be.rejectedWith('CollectionNotFound');135 await expect(rftCollectionForNesting.mintToken(alice, 10n, futureToken.nestingAccount())).to.be.rejectedWith('CollectionNotFound');136 await expect(ftCollectionForNesting.mint(alice, 10n, futureToken.nestingAccount())).to.be.rejectedWith('CollectionNotFound');137138 // 2. Alice cannot mint and nest token:139 const nft = await nftCollectionForNesting.mintToken(alice);140 const rft = await rftCollectionForNesting.mintToken(alice, 100n);141 const _ft = await ftCollectionForNesting.mint(alice, 100n);142 await expect(nft.transfer(alice, futureToken.nestingAccount())).to.be.rejectedWith('CollectionNotFound');143 await expect(rft.transfer(alice, futureToken.nestingAccount())).to.be.rejectedWith('CollectionNotFound');144 await expect(ftCollectionForNesting.transfer(alice, futureToken.nestingAccount(), 50n)).to.be.rejectedWith('CollectionNotFound');145 });124146125 itSub('Cannot nest to a future token', async ({helper}) => {147 itSub('Cannot nest to a future token in a NFT collection', async ({helper}) => {126 const nonExistingCollectionId = await helper.collection.getTotalCount() + 1000;148 const {collectionId} = await helper.nft.mintCollection(alice);149 // To avoid UserIsNotAllowedToNest error150 await helper.collection.setPermissions(alice, collectionId, {nesting: {collectionAdmin: true}});127 const futureToken = helper.nft.getTokenObject(nonExistingCollectionId, 1);151 const futureToken = helper.nft.getTokenObject(collectionId, 1);128152129 const nftCollectionForNesting = await helper.nft.mintCollection(alice);153 const nftCollectionForNesting = await helper.nft.mintCollection(alice);130 const rftCollectionForNesting = await helper.rft.mintCollection(alice);154 const rftCollectionForNesting = await helper.rft.mintCollection(alice);