git.delta.rocks / unique-network / refs/commits / 38774eb63ed6

difftreelog

fix types in tests

Daniel Shiposha2022-12-07parent: #ea3ed4f.patch.diff
in: master

3 files changed

modifiedtests/src/burnItem.test.tsdiffbeforeafterboth
--- a/tests/src/burnItem.test.ts
+++ b/tests/src/burnItem.test.ts
@@ -197,13 +197,12 @@
     expect(await tokenBob.getOwner()).to.deep.eq({Substrate: bob.address});
     // 4. Storage is not corrupted:
     await tokenAlice.transfer(alice, {Substrate: bob.address});
-    await tokenBob.transfer(alice, {Substrate: alice.address});
+    await tokenBob.transfer(bob, {Substrate: alice.address});
     expect(await tokenAlice.getOwner()).to.deep.eq({Substrate: bob.address});
     expect(await tokenBob.getOwner()).to.deep.eq({Substrate: alice.address});
   });
 
   itSub('zero burnFrom NFT', async ({helper}) => {
-    const api = helper.getApi();
     const collection = await helper.nft.mintCollection(alice, {name: 'Zero', description: 'Zero transfer', tokenPrefix: 'TF'});
     const notApprovedNft = await collection.mintToken(alice, {Substrate: bob.address});
     const approvedNft = await collection.mintToken(alice, {Substrate: bob.address});
@@ -212,7 +211,7 @@
     // 1. Zero burnFrom of non-existing tokens not allowed:
     await expect(helper.executeExtrinsic(alice, 'api.tx.unique.burnFrom', [collection.collectionId, {Substrate: bob.address}, 9999, 0])).to.be.rejectedWith('common.ApprovedValueTooLow');
     // 2. Zero burnFrom of not approved tokens not allowed:
-    await expect(helper.executeExtrinsic(alice, 'api.tx.unique.burnFrom', [collection.collectionId, {Substrate: bob.address}, notApprovedNft.tokenId, 0])).to.be.rejectedWith('common.NoPermission');
+    await expect(helper.executeExtrinsic(alice, 'api.tx.unique.burnFrom', [collection.collectionId, {Substrate: bob.address}, notApprovedNft.tokenId, 0])).to.be.rejectedWith('common.ApprovedValueTooLow');
     // 3. Zero burnFrom of approved tokens allowed:
     await helper.executeExtrinsic(alice, 'api.tx.unique.burnFrom', [collection.collectionId, {Substrate: bob.address}, approvedNft.tokenId, 0]);
 
modifiedtests/src/transfer.test.tsdiffbeforeafterboth
206 expect(await tokenBob.getOwner()).to.deep.eq({Substrate: bob.address});206 expect(await tokenBob.getOwner()).to.deep.eq({Substrate: bob.address});
207 // 4. Storage is not corrupted:207 // 4. Storage is not corrupted:
208 await tokenAlice.transfer(alice, {Substrate: bob.address});208 await tokenAlice.transfer(alice, {Substrate: bob.address});
209 await tokenBob.transfer(alice, {Substrate: alice.address});209 await tokenBob.transfer(bob, {Substrate: alice.address});
210 expect(await tokenAlice.getOwner()).to.deep.eq({Substrate: bob.address});210 expect(await tokenAlice.getOwner()).to.deep.eq({Substrate: bob.address});
211 expect(await tokenBob.getOwner()).to.deep.eq({Substrate: alice.address});211 expect(await tokenBob.getOwner()).to.deep.eq({Substrate: alice.address});
212 });212 });
modifiedtests/src/transferFrom.test.tsdiffbeforeafterboth
--- a/tests/src/transferFrom.test.ts
+++ b/tests/src/transferFrom.test.ts
@@ -359,7 +359,7 @@
     // 1. Cannot zero transferFrom (non-existing token)
     await expect(helper.executeExtrinsic(alice, 'api.tx.unique.transferFrom', [{Substrate: bob.address}, {Substrate: alice.address}, collection.collectionId, 9999, 0])).to.be.rejectedWith('common.ApprovedValueTooLow');
     // 2. Cannot zero transferFrom (not approved token)
-    await expect(helper.executeExtrinsic(alice, 'api.tx.unique.transferFrom', [{Substrate: bob.address}, {Substrate: alice.address}, collection.collectionId, notApprovedNft.tokenId, 0])).to.be.rejectedWith('common.NoPermission');
+    await expect(helper.executeExtrinsic(alice, 'api.tx.unique.transferFrom', [{Substrate: bob.address}, {Substrate: alice.address}, collection.collectionId, notApprovedNft.tokenId, 0])).to.be.rejectedWith('common.ApprovedValueTooLow');
     // 3. Can zero transferFrom (approved token):
     await helper.executeExtrinsic(alice, 'api.tx.unique.transferFrom', [{Substrate: bob.address}, {Substrate: alice.address}, collection.collectionId, approvedNft.tokenId, 0]);