difftreelog
tests: disableWhiteListExpectSuccess helper
in: master
1 file changed
tests/src/util/helpers.tsdiffbeforeafterboth605 return newItemId;605 return newItemId;606}606}607607608export async function enableWhiteListExpectSuccess(sender: IKeyringPair, collectionId: number) {608export async function setPublicAccessModeExpectSuccess(609 sender: IKeyringPair, collectionId: number,610 accessMode: 'Normal' | 'WhiteList',611) {609 await usingApi(async (api) => {612 await usingApi(async (api) => {610613611 // Run the transaction614 // Run the transaction612 const tx = api.tx.nft.setPublicAccessMode(collectionId, 'WhiteList');615 const tx = api.tx.nft.setPublicAccessMode(collectionId, accessMode);613 const events = await submitTransactionAsync(sender, tx);616 const events = await submitTransactionAsync(sender, tx);614 const result = getGenericResult(events);617 const result = getGenericResult(events);615618619 // What to expect622 // What to expect620 // tslint:disable-next-line:no-unused-expression623 // tslint:disable-next-line:no-unused-expression621 expect(result.success).to.be.true;624 expect(result.success).to.be.true;622 expect(collection.Access).to.be.equal('WhiteList');625 expect(collection.Access).to.be.equal(accessMode);623 });626 });624}627}628629export async function enableWhiteListExpectSuccess(sender: IKeyringPair, collectionId: number) {630 await setPublicAccessModeExpectSuccess(sender, collectionId, 'WhiteList');631}632633export async function disableWhiteListExpectSuccess(sender: IKeyringPair, collectionId: number) {634 await setPublicAccessModeExpectSuccess(sender, collectionId, 'Normal');635}625636626export async function enablePublicMintingExpectSuccess(sender: IKeyringPair, collectionId: number) {637export async function enablePublicMintingExpectSuccess(sender: IKeyringPair, collectionId: number) {627 await usingApi(async (api) => {638 await usingApi(async (api) => {