git.delta.rocks / unique-network / refs/commits / d41cda7482d4

difftreelog

source

tests/src/rmrk/changeCollectionIssuer.test.ts1.3 KiBsourcehistory
1import {getApiConnection} from '../substrate/substrate-api';2import {expectTxFailure} 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 () => {14    api = await getApiConnection();15  });1617  it('change collection issuer', async () => {18    await createCollection(19      api,20      Alice,21      'test-metadata',22      null,23      'test-symbol',24    ).then(async (collectionId) => {25      await changeIssuer(api, Alice, collectionId, Bob);26    });27  });2829  it('[negative] change not an owner NFT collection issuer', async () => {30    await createCollection(api, Bob, 'test-metadata', null, 'test-symbol').then(async (collectionId) => {31      const tx = changeIssuer(api, Alice, collectionId, Bob);32      await expectTxFailure(/rmrkCore\.NoPermission/, tx);33    });34  });3536  it('[negative] change non-existigit NFT collection issuer', async () => {37    await createCollection(38      api,39      Alice,40      'test-metadata',41      null,42      'test-symbol',43    ).then(async () => {44      const tx = changeIssuer(api, Alice, 99999, Bob);45      await expectTxFailure(/rmrkCore\.CollectionUnknown/, tx);46    });47  });4849  after(() => {50    api.disconnect();51  });52});