1234567import { ApiPromise } from '@polkadot/api';8import { IKeyringPair } from '@polkadot/types/types';9import chai from 'chai';10import chaiAsPromised from 'chai-as-promised';11import privateKey from '../substrate/privateKey';12import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';13import { nftEventMessage } from '../util/helpers';1415chai.use(chaiAsPromised);16const expect = chai.expect;1718describe('Create collection event ', () => {19 let Alice: IKeyringPair;20 const checkSection = 'CollectionCreated';21 const checkTreasury = 'Deposit';22 const checkSystem = 'ExtrinsicSuccess';23 before(async () => {24 await usingApi(async () => {25 Alice = privateKey('//Alice');26 });27 });28 it('Check event from createCollection(): ', async () => {29 await usingApi(async (api: ApiPromise) => {30 const tx = api.tx.nft.createCollection('0x31', '0x32', '0x33', 'NFT');31 const events = await submitTransactionAsync(Alice, tx);32 const msg = JSON.stringify(nftEventMessage(events));33 expect(msg).to.be.contain(checkSection);34 expect(msg).to.be.contain(checkTreasury);35 expect(msg).to.be.contain(checkSystem);36 });37 });38});39