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

difftreelog

Integration tests setConstOnChainSchema and setVariableOnChainSchema fixed

str-mv2021-07-15parent: #430a12f.patch.diff
in: master

4 files changed

modifiedtests/src/change-collection-owner.test.tsdiffbeforeafterboth
12chai.use(chaiAsPromised);12chai.use(chaiAsPromised);
13const expect = chai.expect;13const expect = chai.expect;
1414
15describe.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});
3333
34describe.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();
modifiedtests/src/eth/nonFungible.test.tsdiffbeforeafterboth
61 });61 });
62});62});
6363
64describe.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' },
modifiedtests/src/setConstOnChainSchema.test.tsdiffbeforeafterboth
38 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 });
modifiedtests/src/setVariableOnChainSchema.test.tsdiffbeforeafterboth
38 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 });