git.delta.rocks / unique-network / refs/commits / 1813dc305c53

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(31      async (collectionId) => {32        const tx = changeIssuer(api, Alice, collectionId, Bob);33        await expectTxFailure(/rmrkCore\.NoPermission/, tx);34      }35    );36  });3738  it("[negative] change non-existigit NFT collection issuer", async () => {39    await createCollection(40      api,41      Alice,42      "test-metadata",43      null,44      "test-symbol"45    ).then(async () => {46      const tx = changeIssuer(api, Alice, 99999, Bob);47      await expectTxFailure(/rmrkCore\.CollectionUnknown/, tx);48    });49  });5051  after(() => {52    api.disconnect();53  });54});