git.delta.rocks / unique-network / refs/commits / 8a8e3dd6965d

difftreelog

Merge pull request #68 from usetech-llc/feature/NFTPAR-234

Greg Zaitsev2021-01-19parents: #2390e16 #a246f26.patch.diff
in: master
Feature/nftpar 234

3 files changed

addedtests/src/addToWhiteList.test.tsdiffbeforeafterboth

no changes

modifiedtests/src/toggleContractWhiteList.test.tsdiffbeforeafterboth
--- a/tests/src/toggleContractWhiteList.test.ts
+++ b/tests/src/toggleContractWhiteList.test.ts
@@ -33,7 +33,7 @@
     });
   });
 
-  it.only(`Only whitelisted account can call contract`, async () => {
+  it(`Only whitelisted account can call contract`, async () => {
     await usingApi(async api => {
       const bob = privateKey("//Bob");
 
modifiedtests/src/util/helpers.tsdiffbeforeafterboth
--- a/tests/src/util/helpers.ts
+++ b/tests/src/util/helpers.ts
@@ -620,18 +620,22 @@
 export async function addToWhiteListExpectSuccess(sender: IKeyringPair, collectionId: number, address: string) {
   await usingApi(async (api) => {
 
+    const whiteListedBefore = (await api.query.nft.whiteList(collectionId, address)).toJSON();
+
     // Run the transaction
     const tx = api.tx.nft.addToWhiteList(collectionId, address);
     const events = await submitTransactionAsync(sender, tx);
     const result = getGenericResult(events);
 
-    // Get the collection
-    const collection: any = (await api.query.nft.collection(collectionId)).toJSON();
+    const whiteListedAfter = (await api.query.nft.whiteList(collectionId, address)).toJSON();
 
     // What to expect
     // tslint:disable-next-line:no-unused-expression
     expect(result.success).to.be.true;
-    expect(collection.MintMode).to.be.equal(true);
+    // tslint:disable-next-line: no-unused-expression
+    expect(whiteListedBefore).to.be.false;
+    // tslint:disable-next-line: no-unused-expression
+    expect(whiteListedAfter).to.be.true;
   });
 }