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 {createCollectionExpectSuccess, nftEventMessage} from '../util/helpers';1415chai.use(chaiAsPromised);16const expect = chai.expect;1718describe('Destroy collection event ', () => {19 let alice: IKeyringPair;20 const checkTreasury = 'Deposit';21 const checkSystem = 'ExtrinsicSuccess';22 before(async () => {23 await usingApi(async () => {24 alice = privateKey('//Alice');25 });26 });27 it('Check event from destroyCollection(): ', async () => {28 await usingApi(async (api: ApiPromise) => {29 const collectionID = await createCollectionExpectSuccess();30 const destroyCollection = api.tx.nft.destroyCollection(collectionID);31 const events = await submitTransactionAsync(alice, destroyCollection);32 const msg = JSON.stringify(nftEventMessage(events));33 expect(msg).to.be.contain(checkTreasury);34 expect(msg).to.be.contain(checkSystem);35 });36 });37});