difftreelog
minor fixes
in: master
1 file changed
tests/src/whiteLists.test.tsdiffbeforeafterboth36let Bob: IKeyringPair;36let Bob: IKeyringPair;37let Charlie: IKeyringPair;37let Charlie: IKeyringPair;383839describe.only('Integration Test ext. White list tests', () => {39describe('Integration Test ext. White list tests', () => {404041 before(async () => {41 before(async () => {42 await usingApi(async () => {42 await usingApi(async () => {67 await addToWhiteListExpectFail(Alice, collectionId, Bob.address);67 await addToWhiteListExpectFail(Alice, collectionId, Bob.address);68 });68 });696970 it('Nobody can add address to white list of non-existing collection', async () => {70 it('Nobody can add address to white list of destroyed collection', async () => {71 const collectionId = await createCollectionExpectSuccess();71 const collectionId = await createCollectionExpectSuccess();72 await destroyCollectionExpectSuccess(collectionId, '//Alice');72 await destroyCollectionExpectSuccess(collectionId, '//Alice');73 await addToWhiteListExpectFail(Alice, collectionId, Bob.address);73 await addToWhiteListExpectFail(Alice, collectionId, Bob.address);85 await removeFromWhiteListExpectSuccess(Alice, collectionId, normalizeAccountId(Bob));85 await removeFromWhiteListExpectSuccess(Alice, collectionId, normalizeAccountId(Bob));86 }); 86 }); 878788 it('Owner can remove address from white list', async () => {88 it('Admin can remove address from white list', async () => {89 const collectionId = await createCollectionExpectSuccess();89 const collectionId = await createCollectionExpectSuccess();90 await addCollectionAdminExpectSuccess(Alice, collectionId, Bob);90 await addCollectionAdminExpectSuccess(Alice, collectionId, Bob);91 await addToWhiteListExpectSuccess(Alice, collectionId, Charlie.address);91 await addToWhiteListExpectSuccess(Alice, collectionId, Charlie.address);156 const collectionId = await createCollectionExpectSuccess();156 const collectionId = await createCollectionExpectSuccess();157 const itemId = await createItemExpectSuccess(Alice, collectionId, 'NFT', Alice.address);157 const itemId = await createItemExpectSuccess(Alice, collectionId, 'NFT', Alice.address);158 await enableWhiteListExpectSuccess(Alice, collectionId);158 await enableWhiteListExpectSuccess(Alice, collectionId);159 await addToWhiteListExpectSuccess(Alice, collectionId, Charlie.address);159 await addToWhiteListExpectSuccess(Alice, collectionId, Alice.address);160160161 await transferExpectFailure(161 await transferExpectFailure(162 collectionId,162 collectionId,174 await addToWhiteListExpectSuccess(Alice, collectionId, Alice.address);174 await addToWhiteListExpectSuccess(Alice, collectionId, Alice.address);175 await addToWhiteListExpectSuccess(Alice, collectionId, Charlie.address);175 await addToWhiteListExpectSuccess(Alice, collectionId, Charlie.address);176 await approveExpectSuccess(collectionId, itemId, Alice, Charlie);176 await approveExpectSuccess(collectionId, itemId, Alice, Charlie);177 await removeFromWhiteListExpectSuccess(Alice, collectionId, normalizeAccountId(Charlie));177 await removeFromWhiteListExpectSuccess(Alice, collectionId, normalizeAccountId(Alice));178178179 await transferExpectFailure(179 await transferExpectFailure(180 collectionId,180 collectionId,191 await enableWhiteListExpectSuccess(Alice, collectionId);191 await enableWhiteListExpectSuccess(Alice, collectionId);192192193 await usingApi(async (api) => {193 await usingApi(async (api) => {194 const tx = api.tx.nft.burnItem(collectionId, itemId, normalizeAccountId(Alice.address), 11);194 const tx = api.tx.nft.burnItem(collectionId, itemId, /*normalizeAccountId(Alice.address),*/ 11);195 const badTransaction = async function () { 195 const badTransaction = async function () { 196 await submitTransactionExpectFailAsync(Alice, tx);196 await submitTransactionExpectFailAsync(Alice, tx);197 };197 };259 await createItemExpectSuccess(Bob, collectionId, 'NFT', Bob.address);259 await createItemExpectSuccess(Bob, collectionId, 'NFT', Bob.address);260 });260 });261261262 it('If Public Access mode is set to WhiteList, and Mint Permission is set to false, tokens cannot be created by non-privileged and white listed address', async () => {262 it('If Public Access mode is set to WhiteList, and Mint Permission is set to false, tokens cannot be created by non-privileged and white-listed address', async () => {263 const collectionId = await createCollectionExpectSuccess();263 const collectionId = await createCollectionExpectSuccess();264 await enableWhiteListExpectSuccess(Alice, collectionId);264 await enableWhiteListExpectSuccess(Alice, collectionId);265 await setMintPermissionExpectSuccess(Alice, collectionId, false);265 await setMintPermissionExpectSuccess(Alice, collectionId, false);