difftreelog
tests: destroyCollection respects OwnerCanDestroy
in: master
1 file changed
tests/src/destroyCollection.test.tsdiffbeforeafterboth3// file 'LICENSE', which is part of this source code package.3// file 'LICENSE', which is part of this source code package.4//4//556import { IKeyringPair } from '@polkadot/types/types';6import chai from 'chai';7import chai from 'chai';7import chaiAsPromised from 'chai-as-promised';8import chaiAsPromised from 'chai-as-promised';9import privateKey from './substrate/privateKey';8import { default as usingApi } from "./substrate/substrate-api";10import { default as usingApi } from "./substrate/substrate-api";9import { createCollectionExpectSuccess, destroyCollectionExpectSuccess, destroyCollectionExpectFailure } from "./util/helpers";11import { createCollectionExpectSuccess, destroyCollectionExpectSuccess, destroyCollectionExpectFailure, setCollectionLimitsExpectSuccess } from "./util/helpers";101211chai.use(chaiAsPromised);13chai.use(chaiAsPromised);121426});28});272928describe('(!negative test!) integration test: ext. destroyCollection():', () => {30describe('(!negative test!) integration test: ext. destroyCollection():', () => {31 let alice: IKeyringPair;3233 before(async () => {34 await usingApi(async (api) => {35 alice = privateKey('//Alice');36 });37 });3829 it('(!negative test!) Destroy a collection that never existed', async () => {39 it('(!negative test!) Destroy a collection that never existed', async () => {30 await usingApi(async (api) => {40 await usingApi(async (api) => {43 await destroyCollectionExpectFailure(collectionId, '//Bob');53 await destroyCollectionExpectFailure(collectionId, '//Bob');44 await destroyCollectionExpectSuccess(collectionId, '//Alice');54 await destroyCollectionExpectSuccess(collectionId, '//Alice');45 });55 });56 it('fails when OwnerCanDestroy == false', async () => {57 const collectionId = await createCollectionExpectSuccess();58 await setCollectionLimitsExpectSuccess(alice, collectionId, { OwnerCanDestroy: false });5960 await destroyCollectionExpectFailure(collectionId, '//Alice');61 });46});62});4763