--- a/tests/src/check-event/createCollectionEvent.test.ts +++ b/tests/src/check-event/createCollectionEvent.test.ts @@ -15,15 +15,10 @@ // along with Unique Network. If not, see . // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits -import {ApiPromise} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; +import {executeTransaction} from '../substrate/substrate-api'; import {uniqueEventMessage} from '../util/helpers'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {usingPlaygrounds, itSub, expect} from '../util/playgrounds'; describe('Create collection event ', () => { let alice: IKeyringPair; @@ -31,18 +26,18 @@ const checkTreasury = 'Deposit'; const checkSystem = 'ExtrinsicSuccess'; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([10n], donor); }); }); - it('Check event from createCollection(): ', async () => { - await usingApi(async (api: ApiPromise) => { - const tx = api.tx.unique.createCollectionEx({name: [0x31], description: [0x32], tokenPrefix: '0x33', mode: 'NFT'}); - const events = await submitTransactionAsync(alice, tx); - const msg = JSON.stringify(uniqueEventMessage(events)); - expect(msg).to.be.contain(checkSection); - expect(msg).to.be.contain(checkTreasury); - expect(msg).to.be.contain(checkSystem); - }); + itSub('Check event from createCollection(): ', async ({helper}) => { + const api = helper.api!; + const tx = api.tx.unique.createCollectionEx({name: [0x31], description: [0x32], tokenPrefix: '0x33', mode: 'NFT'}); + const events = await executeTransaction(api, alice, tx); + const msg = JSON.stringify(uniqueEventMessage(events)); + expect(msg).to.be.contain(checkSection); + expect(msg).to.be.contain(checkTreasury); + expect(msg).to.be.contain(checkSystem); }); });