git.delta.rocks / unique-network / refs/commits / c980d88081dd

difftreelog

approve and transferFrom test scenarios

kpozdnikin2021-01-13parent: #3f04d11.patch.diff
in: master

2 files changed

addedtests/src/approve.test.tsdiffbeforeafterboth
after · tests/src/approve.test.ts
1//2// This file is subject to the terms and conditions defined in3// file 'LICENSE', which is part of this source code package.4//5import { ApiPromise } from '@polkadot/api';6import BN from 'bn.js';7import chai from 'chai';8import chaiAsPromised from 'chai-as-promised';9import privateKey from './substrate/privateKey';10import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from './substrate/substrate-api';11import {createCollectionExpectSuccess, destroyCollectionExpectSuccess} from './util/helpers';1213chai.use(chaiAsPromised);14const expect = chai.expect;1516interface ITokenDataType {17  Owner: number[];18  ConstData: number[];19  VariableData: number[];20}2122describe('Integration Test approve(spender, collection_id, item_id, amount):', () => {23  it('Execute the extrinsic and check approvedList', async () => {24    await usingApi(async (api: ApiPromise) => {2526    });27  });28});2930describe('Negative Integration Test approve(spender, collection_id, item_id, amount):', () => {31  it('Approve for a collection that does not exist', async () => {32    await usingApi(async (api: ApiPromise) => {3334    });35  });3637  it('Approve for a collection that was destroyed', async () => {38    await usingApi(async (api: ApiPromise) => {3940    });41  });4243  it('Approve transfer of a token that does not exist', async () => {44    await usingApi(async (api: ApiPromise) => {4546    });47  });4849  it('Approve using the address that does not own the approved token', async () => {50    await usingApi(async (api: ApiPromise) => {5152    });53  });5455  it('Remove approval by using 0 amount', async () => {56    await usingApi(async (api: ApiPromise) => {5758    });59  });60});
addedtests/src/transferFrom.test.tsdiffbeforeafterboth
--- /dev/null
+++ b/tests/src/transferFrom.test.ts
@@ -0,0 +1,72 @@
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+import { ApiPromise } from '@polkadot/api';
+import BN from 'bn.js';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from './substrate/privateKey';
+import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from './substrate/substrate-api';
+import {createCollectionExpectSuccess, destroyCollectionExpectSuccess} from './util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+
+interface ITokenDataType {
+  Owner: number[];
+  ConstData: number[];
+  VariableData: number[];
+}
+
+describe('Integration Test transferFrom(from, recipient, collection_id, item_id, value):', () => {
+  it('Execute the extrinsic and check nftItemList - owner of toren', async () => {
+    await usingApi(async (api: ApiPromise) => {
+
+    });
+  });
+});
+
+describe('Negative Integration Test transferFrom(from, recipient, collection_id, item_id, value):', () => {
+  it('transferFrom for a collection that does not exist', async () => {
+    await usingApi(async (api: ApiPromise) => {
+
+    });
+  });
+
+  it('transferFrom for a collection that was destroyed', async () => {
+    await usingApi(async (api: ApiPromise) => {
+
+    });
+  });
+
+  it('transferFrom a token that does not exist', async () => {
+    await usingApi(async (api: ApiPromise) => {
+
+    });
+  });
+
+  it('transferFrom a token that was deleted', async () => {
+    await usingApi(async (api: ApiPromise) => {
+
+    });
+  });
+
+  it('transferFrom for not approved address', async () => {
+    await usingApi(async (api: ApiPromise) => {
+
+    });
+  });
+
+  it('transferFrom incorrect token count', async () => {
+    await usingApi(async (api: ApiPromise) => {
+
+    });
+  });
+
+  it('execute transferFrom from account that is not owner of collection', async () => {
+    await usingApi(async (api: ApiPromise) => {
+
+    });
+  });
+});