difftreelog
Check event tests fixed
in: master
5 files changed
tests/package.jsondiffbeforeafterboth28 "load": "mocha --timeout 9999999 -r ts-node/register './**/*.load.ts'",28 "load": "mocha --timeout 9999999 -r ts-node/register './**/*.load.ts'",29 "loadTransfer": "ts-node src/transfer.nload.ts",29 "loadTransfer": "ts-node src/transfer.nload.ts",30 "testCollision": "mocha --timeout 9999999 -r ts-node/register ./src/collision-tests/*.test.ts",30 "testCollision": "mocha --timeout 9999999 -r ts-node/register ./src/collision-tests/*.test.ts",31 "testEvent": "mocha --timeout 9999999 -r ts-node/register ./src/check-event/*.test.ts",31 "testAddCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/addCollectionAdmin.test.ts",32 "testAddCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/addCollectionAdmin.test.ts",32 "testSetSchemaVersion": "mocha --timeout 9999999 -r ts-node/register ./**/setSchemaVersion.test.ts",33 "testSetSchemaVersion": "mocha --timeout 9999999 -r ts-node/register ./**/setSchemaVersion.test.ts",33 "testSetVariableMetaData": "mocha --timeout 9999999 -r ts-node/register ./**/setVariableMetaData.test.ts",34 "testSetVariableMetaData": "mocha --timeout 9999999 -r ts-node/register ./**/setVariableMetaData.test.ts",tests/src/check-event/createItemEvent.test.tsdiffbeforeafterboth10import chaiAsPromised from 'chai-as-promised';10import chaiAsPromised from 'chai-as-promised';11import privateKey from '../substrate/privateKey';11import privateKey from '../substrate/privateKey';12import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';12import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';13import { createCollectionExpectSuccess, nftEventMessage } from '../util/helpers';13import { createCollectionExpectSuccess, nftEventMessage, normalizeAccountId } from '../util/helpers';141415chai.use(chaiAsPromised);15chai.use(chaiAsPromised);16const expect = chai.expect;16const expect = chai.expect;28 it('Check event from createItem(): ', async () => {28 it('Check event from createItem(): ', async () => {29 await usingApi(async (api: ApiPromise) => {29 await usingApi(async (api: ApiPromise) => {30 const collectionID = await createCollectionExpectSuccess();30 const collectionID = await createCollectionExpectSuccess();31 const createItem = api.tx.nft.createItem(collectionID, Alice.address, 'NFT');31 const createItem = api.tx.nft.createItem(collectionID, normalizeAccountId(Alice.address), 'NFT');32 const events = await submitTransactionAsync(Alice, createItem);32 const events = await submitTransactionAsync(Alice, createItem);33 const msg = JSON.stringify(nftEventMessage(events));33 const msg = JSON.stringify(nftEventMessage(events));34 expect(msg).to.be.contain(checkSection);34 expect(msg).to.be.contain(checkSection);tests/src/check-event/createMultipleItemsEvent.test.tsdiffbeforeafterboth10import chaiAsPromised from 'chai-as-promised';10import chaiAsPromised from 'chai-as-promised';11import privateKey from '../substrate/privateKey';11import privateKey from '../substrate/privateKey';12import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';12import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';13import { createCollectionExpectSuccess, nftEventMessage } from '../util/helpers';13import { createCollectionExpectSuccess, nftEventMessage, normalizeAccountId } from '../util/helpers';141415chai.use(chaiAsPromised);15chai.use(chaiAsPromised);16const expect = chai.expect;16const expect = chai.expect;29 await usingApi(async (api: ApiPromise) => {29 await usingApi(async (api: ApiPromise) => {30 const collectionID = await createCollectionExpectSuccess();30 const collectionID = await createCollectionExpectSuccess();31 const args = [{ nft: ['0x31', '0x31'] }, { nft: ['0x32', '0x32'] }, { nft: ['0x33', '0x33'] }];31 const args = [{ nft: ['0x31', '0x31'] }, { nft: ['0x32', '0x32'] }, { nft: ['0x33', '0x33'] }];32 const createMultipleItems = api.tx.nft.createMultipleItems(collectionID, Alice.address, args);32 const createMultipleItems = api.tx.nft.createMultipleItems(collectionID, normalizeAccountId(Alice.address), args);33 const events = await submitTransactionAsync(Alice, createMultipleItems);33 const events = await submitTransactionAsync(Alice, createMultipleItems);34 const msg = JSON.stringify(nftEventMessage(events));34 const msg = JSON.stringify(nftEventMessage(events));35 expect(msg).to.be.contain(checkSection);35 expect(msg).to.be.contain(checkSection);tests/src/check-event/transferEvent.test.tsdiffbeforeafterboth10import chaiAsPromised from 'chai-as-promised';10import chaiAsPromised from 'chai-as-promised';11import privateKey from '../substrate/privateKey';11import privateKey from '../substrate/privateKey';12import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';12import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';13import { createCollectionExpectSuccess, createItemExpectSuccess, nftEventMessage } from '../util/helpers';13import { createCollectionExpectSuccess, createItemExpectSuccess, nftEventMessage, normalizeAccountId } from '../util/helpers';141415chai.use(chaiAsPromised);15chai.use(chaiAsPromised);16const expect = chai.expect;16const expect = chai.expect;31 await usingApi(async (api: ApiPromise) => {31 await usingApi(async (api: ApiPromise) => {32 const collectionID = await createCollectionExpectSuccess();32 const collectionID = await createCollectionExpectSuccess();33 const itemID = await createItemExpectSuccess(Alice, collectionID, 'NFT');33 const itemID = await createItemExpectSuccess(Alice, collectionID, 'NFT');34 const transfer = api.tx.nft.transfer(Bob.address, collectionID, itemID, 1);34 const transfer = api.tx.nft.transfer(normalizeAccountId(Bob.address), collectionID, itemID, 1);35 const events = await submitTransactionAsync(Alice, transfer);35 const events = await submitTransactionAsync(Alice, transfer);36 const msg = JSON.stringify(nftEventMessage(events));36 const msg = JSON.stringify(nftEventMessage(events));37 expect(msg).to.be.contain(checkSection);37 expect(msg).to.be.contain(checkSection);tests/src/check-event/transferFromEvent.test.tsdiffbeforeafterboth10import chaiAsPromised from 'chai-as-promised';10import chaiAsPromised from 'chai-as-promised';11import privateKey from '../substrate/privateKey';11import privateKey from '../substrate/privateKey';12import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';12import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';13import { createCollectionExpectSuccess, createItemExpectSuccess, nftEventMessage } from '../util/helpers';13import { createCollectionExpectSuccess, createItemExpectSuccess, nftEventMessage, normalizeAccountId } from '../util/helpers';141415chai.use(chaiAsPromised);15chai.use(chaiAsPromised);16const expect = chai.expect;16const expect = chai.expect;31 await usingApi(async (api: ApiPromise) => {31 await usingApi(async (api: ApiPromise) => {32 const collectionID = await createCollectionExpectSuccess();32 const collectionID = await createCollectionExpectSuccess();33 const itemID = await createItemExpectSuccess(Alice, collectionID, 'NFT');33 const itemID = await createItemExpectSuccess(Alice, collectionID, 'NFT');34 const transferFrom = api.tx.nft.transferFrom(Alice.address, Bob.address, collectionID, itemID, 1);34 const transferFrom = api.tx.nft.transferFrom(normalizeAccountId(Alice.address), normalizeAccountId(Bob.address), collectionID, itemID, 1);35 const events = await submitTransactionAsync(Alice, transferFrom);35 const events = await submitTransactionAsync(Alice, transferFrom);36 const msg = JSON.stringify(nftEventMessage(events));36 const msg = JSON.stringify(nftEventMessage(events));37 expect(msg).to.be.contain(checkSection);37 expect(msg).to.be.contain(checkSection);