1import {getApiConnection} from '../substrate/substrate-api';2import {expectTxFailure, requirePallets, Pallets} from './util/helpers';3import {4 changeIssuer,5 createCollection,6} from './util/tx';78describe('integration test: collection issuer', () => {9 const alice = '//Alice';10 const bob = '//Bob';1112 let api: any;13 before(async function() {14 api = await getApiConnection();15 await requirePallets(this, [Pallets.RmrkCore]);16 });17181920 it('change collection issuer', async () => {21 await createCollection(22 api,23 alice,24 'test-metadata',25 null,26 'test-symbol',27 ).then(async (collectionId) => {28 await changeIssuer(api, alice, collectionId, bob);29 });30 });3132 it('[negative] change not an owner NFT collection issuer', async () => {33 await createCollection(api, bob, 'test-metadata', null, 'test-symbol').then(async (collectionId) => {34 const tx = changeIssuer(api, alice, collectionId, bob);35 await expectTxFailure(/rmrkCore\.NoPermission/, tx);36 });37 });3839 it('[negative] change non-existigit NFT collection issuer', async () => {40 await createCollection(41 api,42 alice,43 'test-metadata',44 null,45 'test-symbol',46 ).then(async () => {47 const tx = changeIssuer(api, alice, 99999, bob);48 await expectTxFailure(/rmrkCore\.CollectionUnknown/, tx);49 });50 });5152 after(async() => { await api.disconnect(); });53});