123456789101112131415161718import {ApiPromise} from '@polkadot/api';19import {IKeyringPair} from '@polkadot/types/types';20import chai from 'chai';21import chaiAsPromised from 'chai-as-promised';22import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';23import {createCollectionExpectSuccess, uniqueEventMessage} from '../util/helpers';2425chai.use(chaiAsPromised);26const expect = chai.expect;2728describe('Destroy collection event ', () => {29 let alice: IKeyringPair;30 const checkTreasury = 'Deposit';31 const checkSystem = 'ExtrinsicSuccess';32 before(async () => {33 await usingApi(async (api, privateKeyWrapper) => {34 alice = privateKeyWrapper('//Alice');35 });36 });37 it('Check event from destroyCollection(): ', async () => {38 await usingApi(async (api: ApiPromise) => {39 const collectionID = await createCollectionExpectSuccess();40 const destroyCollection = api.tx.unique.destroyCollection(collectionID);41 const events = await submitTransactionAsync(alice, destroyCollection);42 const msg = JSON.stringify(uniqueEventMessage(events));43 expect(msg).to.be.contain(checkTreasury);44 expect(msg).to.be.contain(checkSystem);45 });46 });47});