From 866bd05a6b56c171da3898ddfb04f99bf08d1959 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 06 Apr 2022 07:19:44 +0000 Subject: [PATCH] CORE-238 Refactor test --- --- a/tests/package.json +++ b/tests/package.json @@ -67,6 +67,7 @@ "testPalletPresence": "mocha --timeout 9999999 -r ts-node/register ./**/pallet-presence.test.ts", "testBlockProduction": "mocha --timeout 9999999 -r ts-node/register ./**/block-production.test.ts", "testEnableDisableTransfers": "mocha --timeout 9999999 -r ts-node/register ./**/enableDisableTransfer.test.ts", + "testLimits": "mocha --timeout 9999999 -r ts-node/register ./**/limits.test.ts", "polkadot-types-fetch-metadata": "curl -H 'Content-Type: application/json' -d '{\"id\":\"1\", \"jsonrpc\":\"2.0\", \"method\": \"state_getMetadata\", \"params\":[]}' http://localhost:9933 > src/interfaces/metadata.json", "polkadot-types-from-defs": "echo 'export default {}' > src/interfaces/lookup.ts && ts-node ./node_modules/.bin/polkadot-types-from-defs --endpoint src/interfaces/metadata.json --input src/interfaces/ --package .", "polkadot-types-from-chain": "ts-node ./node_modules/.bin/polkadot-types-from-chain --endpoint src/interfaces/metadata.json --output src/interfaces/ --package .", --- a/tests/src/limits.test.ts +++ b/tests/src/limits.test.ts @@ -395,10 +395,8 @@ expect(aliceBalanceAfterSponsoredTransaction1 < aliceBalanceBefore).to.be.true; //expect(aliceBalanceAfterSponsoredTransaction1).to.be.lessThan(aliceBalanceBefore); }); -}); - -describe('Effective collection limits', () => { - it('Test1', async () => { + + it('Effective collection limits', async () => { await usingApi(async (api) => { const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); @@ -419,17 +417,17 @@ expect(limits.ownerCanDestroy.toHuman()).to.be.null; expect(limits.transfersEnabled.toHuman()).to.be.null; } - + { const limits = await api.rpc.unique.effectiveCollectionLimits(11111); expect(limits.toHuman()).to.be.null; } - + { const limitsOpt = await api.rpc.unique.effectiveCollectionLimits(collectionId); expect(limitsOpt.isNone).to.be.false; const limits = limitsOpt.unwrap(); - + expect(limits.accountTokenOwnershipLimit.toHuman()).to.be.eq('100,000'); expect(limits.sponsoredDataSize.toHuman()).to.be.eq('2,048'); expect(limits.sponsoredDataRateLimit.toHuman()).to.be.eq('SponsoringDisabled'); @@ -443,3 +441,5 @@ }); }); }); + + -- gitstuff