difftreelog
Integration tests setConstOnChainSchema and setVariableOnChainSchema fixed
in: master
4 files changed
tests/src/change-collection-owner.test.tsdiffbeforeafterboth12chai.use(chaiAsPromised);12chai.use(chaiAsPromised);13const expect = chai.expect;13const expect = chai.expect;141415describe.only('Integration Test changeCollectionOwner(collection_id, new_owner):', () => {15describe('Integration Test changeCollectionOwner(collection_id, new_owner):', () => {16 it('Changing owner changes owner address', async () => {16 it('Changing owner changes owner address', async () => {17 await usingApi(async api => {17 await usingApi(async api => {18 const collectionId = await createCollectionExpectSuccess();18 const collectionId = await createCollectionExpectSuccess();31 });31 });32});32});333334describe.only('Negative Integration Test changeCollectionOwner(collection_id, new_owner):', () => {34describe('Negative Integration Test changeCollectionOwner(collection_id, new_owner):', () => {35 it('Not owner can\'t change owner.', async () => {35 it('Not owner can\'t change owner.', async () => {36 await usingApi(async api => {36 await usingApi(async api => {37 const collectionId = await createCollectionExpectSuccess();37 const collectionId = await createCollectionExpectSuccess();tests/src/eth/nonFungible.test.tsdiffbeforeafterboth61 });61 });62});62});636364describe.only('Plain calls', () => {64describe('Plain calls', () => {65 itWeb3('Can perform approve()', async ({ web3, api }) => {65 itWeb3('Can perform approve()', async ({ web3, api }) => {66 const collection = await createCollectionExpectSuccess({66 const collection = await createCollectionExpectSuccess({67 mode: { type: 'NFT' },67 mode: { type: 'NFT' },tests/src/setConstOnChainSchema.test.tsdiffbeforeafterboth38 await usingApi(async (api) => {38 await usingApi(async (api) => {39 const collectionId = await createCollectionExpectSuccess();39 const collectionId = await createCollectionExpectSuccess();40 const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();40 const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();41 expect(collection.Owner).to.be.deep.eq(normalizeAccountId(Alice.address));41 expect(collection.Owner).to.be.eq(Alice.address);42 const setShema = api.tx.nft.setConstOnChainSchema(collectionId, Shema);42 const setShema = api.tx.nft.setConstOnChainSchema(collectionId, Shema);43 await submitTransactionAsync(Alice, setShema);43 await submitTransactionAsync(Alice, setShema);44 });44 });88 await usingApi(async (api) => {88 await usingApi(async (api) => {89 const collectionId = await createCollectionExpectSuccess();89 const collectionId = await createCollectionExpectSuccess();90 const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();90 const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();91 expect(collection.Owner).to.be.deep.eq(normalizeAccountId(Alice.address));91 expect(collection.Owner).to.be.eq(Alice.address);92 const setShema = api.tx.nft.setConstOnChainSchema(collectionId, Shema);92 const setShema = api.tx.nft.setConstOnChainSchema(collectionId, Shema);93 await expect(submitTransactionExpectFailAsync(Bob, setShema)).to.be.rejected;93 await expect(submitTransactionExpectFailAsync(Bob, setShema)).to.be.rejected;94 });94 });tests/src/setVariableOnChainSchema.test.tsdiffbeforeafterboth38 await usingApi(async (api) => {38 await usingApi(async (api) => {39 const collectionId = await createCollectionExpectSuccess();39 const collectionId = await createCollectionExpectSuccess();40 const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();40 const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();41 expect(collection.Owner).to.be.deep.eq(normalizeAccountId(Alice.address));41 expect(collection.Owner).to.be.eq(Alice.address);42 const setSchema = api.tx.nft.setVariableOnChainSchema(collectionId, Schema);42 const setSchema = api.tx.nft.setVariableOnChainSchema(collectionId, Schema);43 await submitTransactionAsync(Alice, setSchema);43 await submitTransactionAsync(Alice, setSchema);44 });44 });88 await usingApi(async (api) => {88 await usingApi(async (api) => {89 const collectionId = await createCollectionExpectSuccess();89 const collectionId = await createCollectionExpectSuccess();90 const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();90 const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();91 expect(collection.Owner).to.be.deep.eq(normalizeAccountId(Alice.address));91 expect(collection.Owner).to.be.eq(Alice.address);92 const setSchema = api.tx.nft.setVariableOnChainSchema(collectionId, Schema);92 const setSchema = api.tx.nft.setVariableOnChainSchema(collectionId, Schema);93 await expect(submitTransactionExpectFailAsync(Bob, setSchema)).to.be.rejected;93 await expect(submitTransactionExpectFailAsync(Bob, setSchema)).to.be.rejected;94 });94 });