git.delta.rocks / unique-network / refs/commits / 48f959311e08

difftreelog

source

tests/src/rmrk/changeCollectionIssuer.test.ts1.4 KiBsourcehistory
1import {getApiConnection} from '../substrate/substrate-api';2import {requirePallets, Pallets} from '../deprecated-helpers/helpers';3import {expectTxFailure} from './util/helpers';4import {5  changeIssuer,6  createCollection,7} from './util/tx';89describe('integration test: collection issuer', () => {10  const Alice = '//Alice';11  const Bob = '//Bob';1213  let api: any;14  before(async function() {15    api = await getApiConnection();16    await requirePallets(this, [Pallets.RmrkCore]);17  });18192021  it('change collection issuer', async () => {22    await createCollection(23      api,24      Alice,25      'test-metadata',26      null,27      'test-symbol',28    ).then(async (collectionId) => {29      await changeIssuer(api, Alice, collectionId, Bob);30    });31  });3233  it('[negative] change not an owner NFT collection issuer', async () => {34    await createCollection(api, Bob, 'test-metadata', null, 'test-symbol').then(async (collectionId) => {35      const tx = changeIssuer(api, Alice, collectionId, Bob);36      await expectTxFailure(/rmrkCore\.NoPermission/, tx);37    });38  });3940  it('[negative] change non-existigit NFT collection issuer', async () => {41    await createCollection(42      api,43      Alice,44      'test-metadata',45      null,46      'test-symbol',47    ).then(async () => {48      const tx = changeIssuer(api, Alice, 99999, Bob);49      await expectTxFailure(/rmrkCore\.CollectionUnknown/, tx);50    });51  });5253  after(() => {54    api.disconnect();55  });56});