From 74ad9c34019c2e1713144d8a72289e8d9a228816 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 19 Feb 2021 20:59:34 +0000 Subject: [PATCH] tests: add tests for restriction disabling --- --- a/tests/src/setCollectionLimits.test.ts +++ b/tests/src/setCollectionLimits.test.ts @@ -14,6 +14,8 @@ createCollectionExpectSuccess, getCreatedCollectionCount, getCreateItemResult, getDetailedCollectionInfo, + setCollectionLimitsExpectFailure, + setCollectionLimitsExpectSuccess, } from './util/helpers'; chai.use(chaiAsPromised); @@ -131,4 +133,16 @@ await expect(submitTransactionExpectFailAsync(alice, tx)).to.be.rejected; }); }); + + it('fails when trying to enable OwnerCanTransfer after it was disabled', async () => { + const collectionId = await createCollectionExpectSuccess(); + await setCollectionLimitsExpectSuccess(alice, collectionId, { OwnerCanTransfer: false }); + await setCollectionLimitsExpectFailure(alice, collectionId, { OwnerCanTransfer: true }); + }); + + it('fails when trying to enable OwnerCanDestroy after it was disabled', async () => { + const collectionId = await createCollectionExpectSuccess(); + await setCollectionLimitsExpectSuccess(alice, collectionId, { OwnerCanDestroy: false }); + await setCollectionLimitsExpectFailure(alice, collectionId, { OwnerCanDestroy: true }); + }); }); -- gitstuff