1import {getApiConnection} from '../substrate/substrate-api';2import {expectTxFailure, requirePallets, Pallets} from './util/helpers';3import {createCollection, deleteCollection} from './util/tx';45describe('integration test: delete collection', () => {6 let api: any;7 before(async function () {8 api = await getApiConnection();9 await requirePallets(this, [Pallets.RmrkCore]);10 });1112 const Alice = '//Alice';13 const Bob = '//Bob';1415 it('delete NFT collection', async () => {16 await createCollection(17 api,18 Alice,19 'test-metadata',20 null,21 'test-symbol',22 ).then(async (collectionId) => {23 await deleteCollection(api, Alice, collectionId.toString());24 });25 });2627 it('[negative] delete non-existing NFT collection', async () => {28 const tx = deleteCollection(api, Alice, '99999');29 await expectTxFailure(/rmrkCore\.CollectionUnknown/, tx);30 });3132 it('[negative] delete not an owner NFT collection', async () => {33 await createCollection(34 api,35 Alice,36 'test-metadata',37 null,38 'test-symbol',39 ).then(async (collectionId) => {40 const tx = deleteCollection(api, Bob, collectionId.toString());41 await expectTxFailure(/rmrkCore.NoPermission/, tx);42 });43 });4445 after(() => {46 api.disconnect();47 });48});