difftreelog
CORE-170. White list tests
in: master
2 files changed
tests/src/util/helpers.tsdiffbeforeafterboth1142 });1142 });1143}1143}11441145export async function addToWhiteListAgainExpectSuccess(sender: IKeyringPair, collectionId: number, address: string | AccountId) {1146 await usingApi(async (api) => {11471148 const whiteListedBefore = (await api.query.nft.whiteList(collectionId, address)).toJSON();11491150 // Run the transaction1151 const tx = api.tx.nft.addToWhiteList(collectionId, normalizeAccountId(address));1152 const events = await submitTransactionAsync(sender, tx);1153 const result = getGenericResult(events);11541155 const whiteListedAfter = (await api.query.nft.whiteList(collectionId, address)).toJSON();11561157 // What to expect1158 // tslint:disable-next-line:no-unused-expression1159 expect(result.success).to.be.true;1160 // tslint:disable-next-line: no-unused-expression1161 expect(whiteListedBefore).to.be.true;1162 // tslint:disable-next-line: no-unused-expression1163 expect(whiteListedAfter).to.be.true;1164 });1165}114411661145export async function addToWhiteListExpectFail(sender: IKeyringPair, collectionId: number, address: string | AccountId) {1167export async function addToWhiteListExpectFail(sender: IKeyringPair, collectionId: number, address: string | AccountId) {1146 await usingApi(async (api) => {1168 await usingApi(async (api) => {1169 1147 // Run the transaction1170 // Run the transaction1148 const tx = api.tx.nft.addToWhiteList(collectionId, normalizeAccountId(address));1171 const tx = api.tx.nft.addToWhiteList(collectionId, normalizeAccountId(address));1149 const events = await expect(submitTransactionAsync(sender, tx)).to.be.rejected;1172 const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;1150 const result = getGenericResult(events);1173 const result = getGenericResult(events);115111741152 // What to expect1175 // What to expecttests/src/whiteLists.test.tsdiffbeforeafterbothno changes