difftreelog
tests: removeFromWhiteList helpers
in: master
1 file changed
tests/src/util/helpers.tsdiffbeforeafterboth681 });681 });682}682}683684export async function removeFromWhiteListExpectSuccess(sender: IKeyringPair, collectionId: number, address: string) {685 await usingApi(async (api) => {686 // Run the transaction687 const tx = api.tx.nft.removeFromWhiteList(collectionId, address);688 const events = await submitTransactionAsync(sender, tx);689 const result = getGenericResult(events);690691 // What to expect692 // tslint:disable-next-line:no-unused-expression693 expect(result.success).to.be.true;694 });695}696697export async function removeFromWhiteListExpectFailure(sender: IKeyringPair, collectionId: number, address: string) {698 await usingApi(async (api) => {699 // Run the transaction700 const tx = api.tx.nft.removeFromWhiteList(collectionId, address);701 const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;702 const result = getGenericResult(events);703704 // What to expect705 // tslint:disable-next-line:no-unused-expression706 expect(result.success).to.be.false;707 });708}683709684export const getDetailedCollectionInfo = async (api: ApiPromise, collectionId: number)710export const getDetailedCollectionInfo = async (api: ApiPromise, collectionId: number)685 : Promise<ICollectionInterface | null> => {711 : Promise<ICollectionInterface | null> => {