difftreelog
Add setCollectionProperties negative test
in: master
1 file changed
tests/src/eth/collectionProperties.test.tsdiffbeforeafterboth49 expect(raw.properties).to.deep.equal(testCase.expectedProps);50 expect(raw.properties).to.deep.equal(testCase.expectedProps);50 }));51 }));5253 itEth('Cannot set invalid properties', async({helper}) => {54 const caller = await helper.eth.createAccountWithBalance(donor);55 const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'test', tokenPrefix: 'test', properties: []});56 await collection.addAdmin(alice, {Ethereum: caller});5758 const address = helper.ethAddress.fromCollectionId(collection.collectionId);59 const contract = helper.ethNativeContract.collection(address, 'nft', caller);6061 await expect(contract.methods.setCollectionProperties([{key: '', value: Buffer.from('val1')}]).send({from: caller})).to.be.rejected;62 await expect(contract.methods.setCollectionProperties([{key: 'déjà vu', value: Buffer.from('hmm...')}]).send({from: caller})).to.be.rejected;63 await expect(contract.methods.setCollectionProperties([{key: 'a'.repeat(257), value: Buffer.from('val3')}]).send({from: caller})).to.be.rejected;64 // TODO add more expects65 const raw = (await collection.getData())?.raw;66 expect(raw.properties).to.deep.equal([]);67 });5168526953 // Soft-deprecated: deleteCollectionProperty70 // Soft-deprecated: deleteCollectionProperty75 expect(raw.properties).to.deep.equal(testCase.expectedProps);93 expect(raw.properties).to.deep.equal(testCase.expectedProps);76 }));94 }));95 96 // TODO cannot delete non-existing props and props of non-owned collections779778 itEth('Can be read', async({helper}) => {98 itEth('Can be read', async({helper}) => {79 const caller = helper.eth.createAccount();99 const caller = helper.eth.createAccount();