123456import chai from 'chai';7import chaiAsPromised from 'chai-as-promised';8import { default as usingApi } from "./substrate/substrate-api";9import { createCollectionExpectSuccess, destroyCollectionExpectSuccess, destroyCollectionExpectFailure } from "./util/helpers";1011chai.use(chaiAsPromised);1213describe('integration test: ext. destroyCollection():', () => {14 it('NFT collection can be destroyed', async () => {15 const collectionId = await createCollectionExpectSuccess();16 await destroyCollectionExpectSuccess(collectionId);17 });18 it('Fungible collection can be destroyed', async () => {19 const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});20 await destroyCollectionExpectSuccess(collectionId);21 });22 it('ReFungible collection can be destroyed', async () => {23 const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});24 await destroyCollectionExpectSuccess(collectionId);25 });26});2728describe('(!negative test!) integration test: ext. destroyCollection():', () => {29 it('(!negative test!) Destroy a collection that never existed', async () => {30 await usingApi(async (api) => {31 32 const collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;33 await destroyCollectionExpectFailure(collectionId);34 });35 });36 it('(!negative test!) Destroy a collection that has already been destroyed', async () => {37 const collectionId = await createCollectionExpectSuccess();38 await destroyCollectionExpectSuccess(collectionId);39 await destroyCollectionExpectFailure(collectionId);40 });41 it('(!negative test!) Destroy a collection using non-owner account', async () => {42 const collectionId = await createCollectionExpectSuccess();43 await destroyCollectionExpectFailure(collectionId, '//Bob');44 await destroyCollectionExpectSuccess(collectionId, '//Alice');45 });46});